org.limitless.util
Class NetAddress

java.lang.Object
  extended by org.limitless.util.NetAddress

public class NetAddress
extends java.lang.Object

This class represents the address of a socket - both the hostname and port. The hostname is stored in an unresolved form, and only resolved when something asks for an InetAddress. Note that this is an IMMUTABLE class!

Author:
Brian Jones, Nicholas Pilon

Field Summary
private  java.net.InetAddress address
          The address
private  java.lang.String hostname
          The hostname
private  int port
          The port
 
Constructor Summary
NetAddress(java.net.InetAddress address, int port)
          Create a NetAddress by reverse-resolving the provided InetAddress.
 
Method Summary
 java.net.InetAddress getAddress()
          Accessor for the address
 java.lang.String getHostname()
          Access method for the hostname.
 int getPort()
          Access method for the port.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hostname

private final java.lang.String hostname
The hostname


port

private final int port
The port


address

private final java.net.InetAddress address
The address

Constructor Detail

NetAddress

public NetAddress(java.net.InetAddress address,
                  int port)
Create a NetAddress by reverse-resolving the provided InetAddress.

Method Detail

toString

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

getHostname

public java.lang.String getHostname()
Access method for the hostname.


getPort

public int getPort()
Access method for the port.


getAddress

public java.net.InetAddress getAddress()
Accessor for the address



Copyright © 1995, 2004 Limitless Knowledge Association, All Rights Reserved.