peersim.skipnet
Class SkipnetName

java.lang.Object
  extended by peersim.skipnet.SkipnetName
All Implemented Interfaces:
java.lang.Cloneable

public class SkipnetName
extends java.lang.Object
implements java.lang.Cloneable

Defines a name address for the peersim.extras.am.skipnet protocol.


Field Summary
static char DELIMITER
           
 
Constructor Summary
SkipnetName()
           
SkipnetName(java.lang.String id)
           
 
Method Summary
 java.lang.Object clone()
           
 int compareTo(SkipnetName comp)
           
 boolean equals(SkipnetName comp)
           
 java.lang.String getIdentifier()
           
 int hashCode()
           
static boolean isAtRight(SkipnetName A, SkipnetName B)
          Determine if B is located at the right side of A
 boolean isWithinPrefix(SkipnetName prefix)
          Determines if this name ID has the given prefix
 boolean isWithinPrefix(java.lang.String prefix)
          Determines if this name ID has the given prefix
static boolean liesBetween(SkipnetName A, SkipnetName B, SkipnetName C)
          Determine if B is located between A and C, allowing for the possibility that A==C
static boolean liesBetween(SkipnetName A, SkipnetName B, SkipnetName C, SkipnetUtil.Direction dir)
          Determine if B is located between A and C, when going in direction given by 'dir'
static boolean liesBetweenIncl(SkipnetName A, SkipnetName B, SkipnetName C)
          Determine if B is located between A and C, allowing for the possibility that A==B
 int longestCommonPrefixLength(SkipnetName n)
          Compute the length of the longest common prefix of two name IDs, ignoring delimiters
 void setIdentifier(java.lang.String identifier)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DELIMITER

public static final char DELIMITER
See Also:
Constant Field Values
Constructor Detail

SkipnetName

public SkipnetName()

SkipnetName

public SkipnetName(java.lang.String id)
Method Detail

toString

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

compareTo

public int compareTo(SkipnetName comp)

equals

public boolean equals(SkipnetName comp)

liesBetweenIncl

public static boolean liesBetweenIncl(SkipnetName A,
                                      SkipnetName B,
                                      SkipnetName C)
Determine if B is located between A and C, allowing for the possibility that A==B


isAtRight

public static boolean isAtRight(SkipnetName A,
                                SkipnetName B)
Determine if B is located at the right side of A


liesBetween

public static boolean liesBetween(SkipnetName A,
                                  SkipnetName B,
                                  SkipnetName C)
Determine if B is located between A and C, allowing for the possibility that A==C


isWithinPrefix

public boolean isWithinPrefix(java.lang.String prefix)
Determines if this name ID has the given prefix


isWithinPrefix

public boolean isWithinPrefix(SkipnetName prefix)
Determines if this name ID has the given prefix


longestCommonPrefixLength

public int longestCommonPrefixLength(SkipnetName n)
Compute the length of the longest common prefix of two name IDs, ignoring delimiters


liesBetween

public static boolean liesBetween(SkipnetName A,
                                  SkipnetName B,
                                  SkipnetName C,
                                  SkipnetUtil.Direction dir)
Determine if B is located between A and C, when going in direction given by 'dir'


getIdentifier

public java.lang.String getIdentifier()

setIdentifier

public void setIdentifier(java.lang.String identifier)

hashCode

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

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object