com.isti.util
Class AddrPortListMgr.EntryBlock

java.lang.Object
  extended by com.isti.util.AddrPortListMgr.EntryBlock
Enclosing class:
AddrPortListMgr

public static class AddrPortListMgr.EntryBlock
extends java.lang.Object

Class EntryBlock holds a host-address string and a port number value.


Field Summary
 java.lang.String hostAddrStr
          Host address string.
 int portNumber
          Port number value.
 
Constructor Summary
AddrPortListMgr.EntryBlock(java.lang.String hostAddrStr, int portNumber)
          Creates a data-block that holds a host-address string and a port number value.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares the given object to this one.
 boolean equals(java.lang.String hostAddr, int portNum)
          Compares the given host-address/port-number to those held by this object.
 int hashCode()
          Returns the hash code value for this object.
 java.lang.String toString()
          Returns a string representation of this data-block.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

hostAddrStr

public final java.lang.String hostAddrStr
Host address string.


portNumber

public final int portNumber
Port number value.

Constructor Detail

AddrPortListMgr.EntryBlock

public AddrPortListMgr.EntryBlock(java.lang.String hostAddrStr,
                                  int portNumber)
Creates a data-block that holds a host-address string and a port number value.

Parameters:
hostAddrStr - the host address string to use.
portNumber - the port number to use.
Method Detail

equals

public boolean equals(java.lang.Object obj)
Compares the given object to this one.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare.
Returns:
true if the given object is a 'EntryBlock' containing equal host address string and port number fields.

equals

public boolean equals(java.lang.String hostAddr,
                      int portNum)
Compares the given host-address/port-number to those held by this object.

Parameters:
hostAddr - the host address to use.
portNum - the port number to use.
Returns:
true if the given host-address/port-number equals the host address string and port number fields held by this object.

hashCode

public int hashCode()
Returns the hash code value for this object. The hash code for the string returned via 'toString()' is used.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code value for this object.

toString

public java.lang.String toString()
Returns a string representation of this data-block. The string is in the form "hostAddr:portNum", where ':' is the separator character defined via the 'AddrPortListMgr.setSeparatorChar()' method (default is ':').

Overrides:
toString in class java.lang.Object
Returns:
A new string representation of this data-block.