Android
java.net
public class

java.net.InetSocketAddress

java.lang.Object
java.net.SocketAddress Serializable
java.net.InetSocketAddress

Summary

Public Constructors

            InetSocketAddress(int port)
            InetSocketAddress(InetAddress address, int port)
            InetSocketAddress(String host, int port)

Public Methods

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

Details

Public Constructors

public InetSocketAddress(int port)

public InetSocketAddress(InetAddress address, int port)

public InetSocketAddress(String host, int port)

Public Methods

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.

Returns

  • an InetSocketAddress instance.

Throws

IllegalArgumentException if host is null or the port is not in the range between 0 and 65535.

public final boolean equals(Object socketAddr)

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 (==).

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.

public final InetAddress getAddress()

public final String getHostName()

public final int getPort()

public final int hashCode()

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.

Returns

  • int the receiver's hash.

public final boolean isUnresolved()

public String toString()

Returns a string containing a concise, human-readable description of the receiver.

Returns

  • String a printable representation for the receiver.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48