org.mortbay.util

Class InetAddrPort

public class InetAddrPort extends Object implements Serializable

InetAddress and Port.
Field Summary
static String__0_0_0_0
Constructor Summary
InetAddrPort()
InetAddrPort(int port)
Constructor for a port on all local host address.
InetAddrPort(InetAddress addr, int port)
Constructor.
InetAddrPort(String host, int port)
Constructor.
InetAddrPort(String inetAddrPort)
Constructor.
InetAddrPort(InetAddrPort address)
Constructor.
Method Summary
Objectclone()
Clone the InetAddrPort.
booleanequals(Object o)
Equals.
StringgetHost()
Get the Host.
InetAddressgetInetAddress()
Get the IP address.
intgetPort()
Get the port.
inthashCode()
Hash Code.
voidsetHost(String host)
Set the Host.
voidsetInetAddress(InetAddress addr)
Set the IP address.
voidsetPort(int port)
Set the port.
StringtoString()

Field Detail

__0_0_0_0

public static final String __0_0_0_0

Constructor Detail

InetAddrPort

public InetAddrPort()

InetAddrPort

public InetAddrPort(int port)
Constructor for a port on all local host address.

Parameters: port

InetAddrPort

public InetAddrPort(InetAddress addr, int port)
Constructor.

Parameters: addr port

InetAddrPort

public InetAddrPort(String host, int port)
Constructor.

Parameters: host port

InetAddrPort

public InetAddrPort(String inetAddrPort)
Constructor.

Parameters: inetAddrPort String of the form "addr:port"

InetAddrPort

public InetAddrPort(InetAddrPort address)
Constructor.

Parameters: address InetAddrPort top copy.

Method Detail

clone

public Object clone()
Clone the InetAddrPort.

Returns: A new instance.

equals

public boolean equals(Object o)
Equals.

Parameters: o

Returns: True if is the same address and port.

getHost

public String getHost()
Get the Host.

Returns: The IP address

getInetAddress

public InetAddress getInetAddress()
Get the IP address.

Returns: The IP address

getPort

public int getPort()
Get the port.

Returns: The port number

hashCode

public int hashCode()
Hash Code.

Returns: hash Code.

setHost

public void setHost(String host)
Set the Host.

Parameters: host

Throws: java.net.UnknownHostException

setInetAddress

public void setInetAddress(InetAddress addr)
Set the IP address.

Parameters: addr The IP address

setPort

public void setPort(int port)
Set the port.

Parameters: port The port number

toString

public String toString()
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.