hypercast.HC
Class HC_AddressPair

java.lang.Object
  |
  +--hypercast.HC.HC_AddressPair
All Implemented Interfaces:
I_AddressPair

public final class HC_AddressPair
extends java.lang.Object
implements I_AddressPair

This class encapsulates the functions of the Logical-Physical Address pair. * It provides both physical and logical address for a hypercube overlay node. We also include the concept of age of the variable so that we can use this same class in the Neigborhood View


Method Summary
 boolean age()
          Ages a AddressPair entry and returns true if the AddressPair is still "alive".
 boolean equals(java.lang.Object o)
           
 int getAge()
          Gets the age of the node
 hypercast.I_LogicalAddress getLogicalAddress()
          Gets a copy of the internal HC_LogicalAddress object, or null if the object is null.
 hypercast.I_PhysicalAddress getPhysicalAddress()
          Gets a copy of the internal I_PhysicalAddress object, or null if the object is null.
 void resetAge()
          Resets Age to MaxAge + MaxMissingNeighbor.
 void setAge(int age)
          Sets Age to the new age.
 java.lang.String toString()
          Gets the string format of the HC_AddressPair object return string format: nnn.nnn.nnn.nnn/nnnn:LA repeate
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

age

public boolean age()
Ages a AddressPair entry and returns true if the AddressPair is still "alive". Decreases age by 1 if age is greater than 0, and then returns true if age is still greater than 0.

Returns:
true if the data is not stale, and false, otherwise

resetAge

public void resetAge()
Resets Age to MaxAge + MaxMissingNeighbor.


setAge

public void setAge(int age)
Sets Age to the new age.

Parameters:
age - the new age

getAge

public int getAge()
Gets the age of the node

Returns:
age of the node

getLogicalAddress

public hypercast.I_LogicalAddress getLogicalAddress()
Gets a copy of the internal HC_LogicalAddress object, or null if the object is null.

Specified by:
getLogicalAddress in interface I_AddressPair
Returns:
copy of HC_LogicalAddress stored

getPhysicalAddress

public hypercast.I_PhysicalAddress getPhysicalAddress()
Gets a copy of the internal I_PhysicalAddress object, or null if the object is null.

Specified by:
getPhysicalAddress in interface I_AddressPair
Returns:
copy of PhysicalAddress stored

toString

public java.lang.String toString()
Gets the string format of the HC_AddressPair object return string format: nnn.nnn.nnn.nnn/nnnn:LA repeate

Overrides:
toString in class java.lang.Object
Returns:
String representation of the object

equals

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