org.siprop.v2.util.impl
Class Peer

java.lang.Object
  extended by org.siprop.v2.util.impl.Peer
All Implemented Interfaces:
java.io.Serializable

public class Peer
extends java.lang.Object
implements java.io.Serializable

IP address, port, and protocol name.

Author:
noritsuna
See Also:
Serialized Form

Field Summary
static int IPPROTO_TCP
          Protocol number for TCP.
static int IPPROTO_UDP
          Protocol number for UDP.
 
Constructor Summary
Peer(int protocol, java.net.InetAddress host, int port)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
          equals.
 java.net.InetAddress getAddress()
          get ip address.
 java.net.InetAddress getHost()
          get hostname.
 int getPort()
          get port.
 int getProtocol()
          get protocol number.
 int hashCode()
          get hash code.
 boolean isConnectionOrientedProtocol()
          check connection oriented protocol.
 boolean isInner()
          inner flag.
 void setInner(boolean isInner)
          set inner flag.
 java.lang.String toString()
          to protocol string.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

IPPROTO_TCP

public static final int IPPROTO_TCP
Protocol number for TCP.

See Also:
Constant Field Values

IPPROTO_UDP

public static final int IPPROTO_UDP
Protocol number for UDP.

See Also:
Constant Field Values
Constructor Detail

Peer

public Peer(int protocol,
            java.net.InetAddress host,
            int port)
Constructor.

Parameters:
protocol -
host -
port -
Method Detail

getHost

public java.net.InetAddress getHost()
get hostname.

Returns:
host information

getAddress

public java.net.InetAddress getAddress()
get ip address.

Returns:
ip address

getPort

public int getPort()
get port.

Returns:
port number

getProtocol

public int getProtocol()
get protocol number.

Returns:
protocol number

isConnectionOrientedProtocol

public boolean isConnectionOrientedProtocol()
check connection oriented protocol.

Returns:
connection oriented protocol is true

hashCode

public int hashCode()
get hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
hash code

equals

public boolean equals(java.lang.Object obj)
equals.

Overrides:
equals in class java.lang.Object
Returns:
equal is true

toString

public java.lang.String toString()
to protocol string.

Overrides:
toString in class java.lang.Object
Returns:
protocol string

isInner

public boolean isInner()
inner flag.

Returns:
inner is true

setInner

public void setInner(boolean isInner)
set inner flag.

Parameters:
isInner - inner is true