sg.edu.nus.peer.info
Class PhysicalInfo

java.lang.Object
  extended by sg.edu.nus.peer.info.PhysicalInfo
All Implemented Interfaces:
java.io.Serializable

public class PhysicalInfo
extends java.lang.Object
implements java.io.Serializable

Keeping the physical information of the node, i.e., IP address and port.

Version:
1.0 2006-2-6
Author:
Vu Quang Hieu, (Modified by) Xu Linhao
See Also:
Serialized Form

Constructor Summary
PhysicalInfo(java.lang.String serializeData)
          Construct the physical information of the node with a serialized string value.
PhysicalInfo(java.lang.String ip, int port)
          Construct the physical information of the node with IP address and port.
 
Method Summary
 boolean equals(java.lang.Object comparedObject)
          Determine whether two PhysicalInfo are equal.
 java.lang.String getIP()
          Get the IP address of the node.
 int getPort()
          Get the port used for monitoring network events.
 java.lang.String serialize()
          Get the serialized string representation of the PhysicalInfo.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PhysicalInfo

public PhysicalInfo(java.lang.String ip,
                    int port)
Construct the physical information of the node with IP address and port.

Parameters:
ip - the IP address of the node
port - the port

PhysicalInfo

public PhysicalInfo(java.lang.String serializeData)
Construct the physical information of the node with a serialized string value.

Parameters:
serializeData - the serialized string value
Method Detail

getIP

public java.lang.String getIP()
Get the IP address of the node.

Returns:
the IP address of the node

getPort

public int getPort()
Get the port used for monitoring network events.

Returns:
the port

equals

public boolean equals(java.lang.Object comparedObject)
Determine whether two PhysicalInfo are equal.

Overrides:
equals in class java.lang.Object
Returns:
if equal, return true; otherwise, return false

toString

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

serialize

public java.lang.String serialize()
Get the serialized string representation of the PhysicalInfo.

Returns:
the serialized string representation of the PhysicalInfo