All Packages Class Hierarchy This Package Previous Next Index
Class AcmeNet.Util.NetAddress
AcmeNet.Util.NetAddress
- public class NetAddress
Identifies a "location" that packets can be sent to or from in AcmeNet.
A NetAddress consists of an Internet address (roughly, a machine) and a port number.
- See Also:
- NetworkInterface
-
NetAddress(InetAddress, int)
-
-
NetAddress(int)
- Creates a NetAddress referring to a port on the local machine.
-
NetAddress(String, int)
-
-
equals(Object)
-
-
getInetAddress()
-
-
getPort()
-
-
hashCode()
-
-
toString()
-
NetAddress
public NetAddress(InetAddress a,
int p)
- Parameters:
- a - the address of a machine on the Internet
- p - a port number on that machine
NetAddress
public NetAddress(String s,
int p) throws UnknownHostException
- Parameters:
- s - the name of a machine on the Internet
- p - a port number on that machine
- Throws: UnknownHostException
- no machine with the requested name was found
NetAddress
public NetAddress(int p) throws UnknownHostException
- Creates a NetAddress referring to a port on the local machine.
- Parameters:
- p - a port number on the local machine
- Throws: UnknownHostException
- the Internet address of the local machine could not be determined (probably means the machine isn't connected to the Net, or is deeply confused)
getInetAddress
public InetAddress getInetAddress()
- Returns:
- s the Internet address portion of this NetAddress
getPort
public int getPort()
- Returns:
- s the port-number portion of this NetAddress
toString
public String toString()
- Returns:
- s a printable representation of this NetAddress
equals
public boolean equals(Object o)
- Returns:
- s true if o is a NetAddress equivalent to this one
hashCode
public int hashCode()
All Packages Class Hierarchy This Package Previous Next Index