sg.edu.nus.peer.info
Class LogicalInfo

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

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

Define the position of the node in the BATON tree, i.e., the logical identifier of the node with both number and level.

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

Constructor Summary
LogicalInfo(int level, int number)
          Construct the logical identifier of the node.
LogicalInfo(java.lang.String serializeData)
          Construct the logical identifier of the node with a serialized string.
 
Method Summary
 boolean equals(java.lang.Object comparedObject)
          Determine if two LogicalInfo is equal.
 int getLevel()
          Get the level of the node in the tree.
 int getNumber()
          Get the position of the node in the level of the tree.
 java.lang.String serialize()
          Get the serialized string representation of the LogicalInfo.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogicalInfo

public LogicalInfo(int level,
                   int number)
Construct the logical identifier of the node.

Parameters:
level - the level of the node in the tree
number - the number of the node in the level

LogicalInfo

public LogicalInfo(java.lang.String serializeData)
Construct the logical identifier of the node with a serialized string.

Parameters:
serializeData - the serialized string used for constructing the LogicalInfo
Method Detail

getLevel

public int getLevel()
Get the level of the node in the tree.

Returns:
the level of the node in the tree

getNumber

public int getNumber()
Get the position of the node in the level of the tree.

Returns:
the position of the node in the level of the tree

equals

public boolean equals(java.lang.Object comparedObject)
Determine if two LogicalInfo is 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 LogicalInfo.

Returns:
the serialized string representation of the LogicalInfo