org.mortbay.util
Class InetAddrPort

java.lang.Object
  extended by org.mortbay.util.InetAddrPort
All Implemented Interfaces:
java.io.Serializable

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

InetAddress and Port.

See Also:
Serialized Form

Field Summary
static java.lang.String __0_0_0_0
           
 
Constructor Summary
InetAddrPort()
           
InetAddrPort(java.net.InetAddress addr, int port)
          Constructor.
InetAddrPort(InetAddrPort address)
          Constructor.
InetAddrPort(int port)
          Constructor for a port on all local host address.
InetAddrPort(java.lang.String inetAddrPort)
          Constructor.
InetAddrPort(java.lang.String host, int port)
          Constructor.
 
Method Summary
 java.lang.Object clone()
          Clone the InetAddrPort.
 boolean equals(java.lang.Object o)
          Equals.
 java.lang.String getHost()
          Get the Host.
 java.net.InetAddress getInetAddress()
          Get the IP address.
 int getPort()
          Get the port.
 int hashCode()
          Hash Code.
 void setHost(java.lang.String host)
          Set the Host.
 void setInetAddress(java.net.InetAddress addr)
          Set the IP address.
 void setPort(int port)
          Set the port.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

__0_0_0_0

public static final java.lang.String __0_0_0_0
See Also:
Constant Field Values
Constructor Detail

InetAddrPort

public InetAddrPort()

InetAddrPort

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

Parameters:
port -

InetAddrPort

public InetAddrPort(java.net.InetAddress addr,
                    int port)
Constructor.

Parameters:
addr -
port -

InetAddrPort

public InetAddrPort(java.lang.String host,
                    int port)
             throws java.net.UnknownHostException
Constructor.

Parameters:
host -
port -
Throws:
java.net.UnknownHostException

InetAddrPort

public InetAddrPort(java.lang.String inetAddrPort)
             throws java.net.UnknownHostException
Constructor.

Parameters:
inetAddrPort - String of the form "addr:port"
Throws:
java.net.UnknownHostException

InetAddrPort

public InetAddrPort(InetAddrPort address)
Constructor.

Parameters:
address - InetAddrPort top copy.
Method Detail

getHost

public java.lang.String getHost()
Get the Host.

Returns:
The IP address

setHost

public void setHost(java.lang.String host)
             throws java.net.UnknownHostException
Set the Host.

Parameters:
host -
Throws:
java.net.UnknownHostException

getInetAddress

public java.net.InetAddress getInetAddress()
Get the IP address.

Returns:
The IP address

setInetAddress

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

Parameters:
addr - The IP address

getPort

public int getPort()
Get the port.

Returns:
The port number

setPort

public void setPort(int port)
Set the port.

Parameters:
port - The port number

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Clone the InetAddrPort.

Overrides:
clone in class java.lang.Object
Returns:
A new instance.

hashCode

public int hashCode()
Hash Code.

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

equals

public boolean equals(java.lang.Object o)
Equals.

Overrides:
equals in class java.lang.Object
Parameters:
o -
Returns:
True if is the same address and port.


Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.