org.otfeed.event
Class OTHost

java.lang.Object
  extended by org.otfeed.event.OTHost
All Implemented Interfaces:
java.lang.Comparable<OTHost>

public final class OTHost
extends java.lang.Object
implements java.lang.Comparable<OTHost>

Encapsulates hostname and port pair.


Constructor Summary
OTHost()
          Default constructor
OTHost(java.lang.String address)
          Constructor that parses string in the form "host:port"
OTHost(java.lang.String host, int port)
          Constructor with parameter initialization
 
Method Summary
 int compareTo(OTHost other)
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getHost()
          Returns host value.
 int getPort()
          Returns port value.
 int hashCode()
           
 void setHost(java.lang.String host)
          Sets host name.
 void setPort(int port)
          Sets port value;
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OTHost

public OTHost()
Default constructor


OTHost

public OTHost(java.lang.String host,
              int port)
Constructor with parameter initialization

Parameters:
host - server host
port - server port

OTHost

public OTHost(java.lang.String address)
Constructor that parses string in the form "host:port"

Parameters:
address -
Method Detail

setHost

public void setHost(java.lang.String host)
Sets host name.

Parameters:
host - host name.

getHost

public java.lang.String getHost()
Returns host value.

Returns:
host value.

setPort

public void setPort(int port)
Sets port value;

Parameters:
port - port value.

getPort

public int getPort()
Returns port value.

Returns:
port value.

toString

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(OTHost other)
Specified by:
compareTo in interface java.lang.Comparable<OTHost>


Copyright © 2007 Mike Kroutikov. All Rights Reserved.