Build 1.0_r1(from source)

java.net
Class InetSocketAddress

java.lang.Object
  extended by java.net.SocketAddress
      extended by java.net.InetSocketAddress
All Implemented Interfaces:
Serializable

public class InetSocketAddress
extends SocketAddress

See Also:
Serialized Form

Constructor Summary
InetSocketAddress(InetAddress address, int port)
           
InetSocketAddress(int port)
           
InetSocketAddress(String host, int port)
           
InetSocketAddress(String host, int port, boolean needResolved)
           
 
Method Summary
static InetSocketAddress createUnresolved(String host, int port)
          Creats an InetSocketAddress without trying to resolve hostname into an InetAddress.
 boolean equals(Object socketAddr)
          Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
 InetAddress getAddress()
           
 String getHostName()
           
 int getPort()
           
 int hashCode()
          Returns an integer hash code for the receiver.
 boolean isUnresolved()
           
 String toString()
          Returns a string containing a concise, human-readable description of the receiver.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InetSocketAddress

public InetSocketAddress(int port)

InetSocketAddress

public InetSocketAddress(InetAddress address,
                         int port)

InetSocketAddress

public InetSocketAddress(String host,
                         int port)

InetSocketAddress

InetSocketAddress(String host,
                  int port,
                  boolean needResolved)
Method Detail

createUnresolved

public static InetSocketAddress createUnresolved(String host,
                                                 int port)
Creats an InetSocketAddress without trying to resolve hostname into an InetAddress. The address field is marked as unresolved.

Parameters:
host -
port -
Returns:
an InetSocketAddress instance.
Throws:
IllegalArgumentException - if host is null or the port is not in the range between 0 and 65535.

getPort

public final int getPort()

getAddress

public final InetAddress getAddress()

getHostName

public final String getHostName()

isUnresolved

public final boolean isUnresolved()

toString

public String toString()
Description copied from class: Object
Returns a string containing a concise, human-readable description of the receiver.

Overrides:
toString in class Object
Returns:
String a printable representation for the receiver.

equals

public final boolean equals(Object socketAddr)
Description copied from class: Object
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. The implementation in Object returns true only if the argument is the exact same object as the receiver (==).

Overrides:
equals in class Object
Parameters:
socketAddr - Object the object to compare with this object.
Returns:
boolean true if the object is the same as this object false if it is different from this object.
See Also:
Object.hashCode()

hashCode

public final int hashCode()
Description copied from class: Object
Returns an integer hash code for the receiver. Any two objects which answer true when passed to .equals must answer the same value for this method.

Overrides:
hashCode in class Object
Returns:
int the receiver's hash.
See Also:
Object.equals(java.lang.Object)

Build 1.0_r1(from source)

Please submit a feedback, bug or feature