jist.swans.net
Class NetAddress

java.lang.Object
  extended by jist.swans.net.NetAddress

public class NetAddress
extends java.lang.Object

Contains a Network address.

Since:
SWANS1.0

Field Summary
static NetAddress ANY
          Broadcast network address.
static NetAddress[] EMPTY_ARRAY
          Zero-length array of NetAddress type.
static NetAddress LOCAL
          Loopback network address.
static NetAddress NULL
          Null/invalid network address.
 
Constructor Summary
NetAddress(byte[] addr)
          Create a new network address object.
NetAddress(java.net.InetAddress ip)
          Create a new network address object.
NetAddress(int i)
          Create a new network address object.
 
Method Summary
 boolean equals(java.lang.Object o)
          Return whether this network address is equal to another object.
 java.net.InetAddress getIP()
          Return IP address information.
 int hashCode()
          Compute hash code for network address.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCAL

public static final NetAddress LOCAL
Loopback network address.


NULL

public static final NetAddress NULL
Null/invalid network address.


ANY

public static final NetAddress ANY
Broadcast network address.


EMPTY_ARRAY

public static final NetAddress[] EMPTY_ARRAY
Zero-length array of NetAddress type.

Constructor Detail

NetAddress

public NetAddress(java.net.InetAddress ip)
Create a new network address object.

Parameters:
ip - address data

NetAddress

public NetAddress(byte[] addr)
Create a new network address object.

Parameters:
addr - address data

NetAddress

public NetAddress(int i)
Create a new network address object.

Parameters:
i - address data
Method Detail

hashCode

public int hashCode()
Compute hash code for network address.

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

equals

public boolean equals(java.lang.Object o)
Return whether this network address is equal to another object.

Overrides:
equals in class java.lang.Object
Parameters:
o - object to test equality against
Returns:
whether object provided is equal to this network address

getIP

public java.net.InetAddress getIP()
Return IP address information.

Returns:
IP address information

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object