org.mortbay.util

Class InetAddrPort

Implemented Interfaces:
Serializable

public class InetAddrPort
extends java.lang.Object
implements Serializable

InetAddress and Port.

Field Summary

static String
__0_0_0_0

Constructor Summary

InetAddrPort()
InetAddrPort(InetAddress addr, int port)
Constructor.
InetAddrPort(String inetAddrPort)
Constructor.
InetAddrPort(String host, int port)
Constructor.
InetAddrPort(int port)
Constructor for a port on all local host address.
InetAddrPort(InetAddrPort address)
Constructor.

Method Summary

Object
clone()
Clone the InetAddrPort.
boolean
equals(Object o)
Equals.
String
getHost()
Get the Host.
InetAddress
getInetAddress()
Get the IP address.
int
getPort()
Get the port.
int
hashCode()
Hash Code.
void
setHost(String host)
Set the Host.
void
setInetAddress(InetAddress addr)
Set the IP address.
void
setPort(int port)
Set the port.
String
toString()

Field Details

__0_0_0_0

public static final String __0_0_0_0

Constructor Details

InetAddrPort

public InetAddrPort()

InetAddrPort

public InetAddrPort(InetAddress addr,
                    int port)
Constructor.
Parameters:
addr -
port -

InetAddrPort

public InetAddrPort(String inetAddrPort)
            throws java.net.UnknownHostException
Constructor.
Parameters:
inetAddrPort - String of the form "addr:port"

InetAddrPort

public InetAddrPort(String host,
                    int port)
            throws java.net.UnknownHostException
Constructor.
Parameters:
host -
port -

InetAddrPort

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

InetAddrPort

public InetAddrPort(InetAddrPort address)
Constructor.
Parameters:
address - InetAddrPort top copy.

Method Details

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)
            throws java.net.UnknownHostException
Set the Host.
Parameters:
host -

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.