hypercast.SPT
Class SPT_AddressPair

java.lang.Object
  |
  +--hypercast.SPT.SPT_AddressPair
All Implemented Interfaces:
I_AddressPair

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

A physical & logical address pair for the Spanning Tree Protocol.


Constructor Summary
SPT_AddressPair(hypercast.I_PhysicalAddress pa, hypercast.SPT.SPT_LogicalAddress la)
          Constructor
 
Method Summary
 boolean equals(java.lang.Object o)
           
 boolean equals(hypercast.SPT.SPT_AddressPair ap)
          To check if it's equal to another address pair
 hypercast.I_LogicalAddress getLogicalAddress()
          Returns the logical address of this addresspair
 hypercast.I_PhysicalAddress getPhysicalAddress()
          Returns the physical address of this addresspair
 hypercast.SPT.SPT_LogicalAddress getSPTLogicalAddress()
          Same as getLogicalAddress(), except the returned object type does not need to be coerced to type SPT_LogicalAddress.
 boolean isBetterThan(hypercast.SPT.SPT_AddressPair ap)
          Is it a better root/parent than ap? Used by SPT protocol to make parent choice
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SPT_AddressPair

public SPT_AddressPair(hypercast.I_PhysicalAddress pa,
                       hypercast.SPT.SPT_LogicalAddress la)
Constructor

Parameters:
pa - physical address
la - logical address
Method Detail

getPhysicalAddress

public hypercast.I_PhysicalAddress getPhysicalAddress()
Description copied from interface: I_AddressPair
Returns the physical address of this addresspair

Specified by:
getPhysicalAddress in interface I_AddressPair
Returns:
the physical address

getLogicalAddress

public hypercast.I_LogicalAddress getLogicalAddress()
Description copied from interface: I_AddressPair
Returns the logical address of this addresspair

Specified by:
getLogicalAddress in interface I_AddressPair
Returns:
the logical address

getSPTLogicalAddress

public hypercast.SPT.SPT_LogicalAddress getSPTLogicalAddress()
Same as getLogicalAddress(), except the returned object type does not need to be coerced to type SPT_LogicalAddress.

Returns:
the SPT logical address

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
"PA:" + PA.toString() + " LA:" + LA.toString()

equals

public boolean equals(hypercast.SPT.SPT_AddressPair ap)
To check if it's equal to another address pair

Parameters:
ap - another address pair
Returns:
whether they are equal

equals

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

isBetterThan

public boolean isBetterThan(hypercast.SPT.SPT_AddressPair ap)
Is it a better root/parent than ap? Used by SPT protocol to make parent choice

Parameters:
ap - another address pair
Returns:
whether this address pair better than the other address pair