ePOST API

rice.p2p.past.gc
Class GCIdRange

java.lang.Object
  extended by rice.p2p.past.gc.GCIdRange
All Implemented Interfaces:
java.io.Serializable, IdRange

public class GCIdRange
extends java.lang.Object
implements IdRange

Version:
$Id: GCIdRange.java 2693 2005-08-05 14:00:47Z jeffh $
Author:
Alan Mislove
See Also:
Serialized Form

Field Summary
protected  IdRange range
          The internal (normal) IdRange
 
Constructor Summary
GCIdRange(IdRange range)
          Constructor, which takes a normal IdRange
 
Method Summary
 boolean containsId(Id key)
          test if a given key lies within this range
 IdRange diffRange(IdRange range)
          diffs the given range with this range
 Id getCCWId()
          get counterclockwise edge of range
 IdRange getComplementRange()
          get the complement of this range
 Id getCWId()
          get clockwise edge of range
 IdRange getRange()
          Returns the internal range
 IdRange intersectRange(IdRange range)
          intersects the given range with this range
 boolean isEmpty()
          returns whether or not this range is empty
 IdRange mergeRange(IdRange range)
          merges the given range with this range
 java.lang.String toString()
          Returns a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

range

protected IdRange range
The internal (normal) IdRange

Constructor Detail

GCIdRange

public GCIdRange(IdRange range)
Constructor, which takes a normal IdRange

Parameters:
range - The normal range
Method Detail

getRange

public IdRange getRange()
Returns the internal range

Returns:
The internal range

containsId

public boolean containsId(Id key)
test if a given key lies within this range

Specified by:
containsId in interface IdRange
Parameters:
key - the key
Returns:
true if the key lies within this range, false otherwise

getCCWId

public Id getCCWId()
get counterclockwise edge of range

Specified by:
getCCWId in interface IdRange
Returns:
the id at the counterclockwise edge of the range (inclusive)

getCWId

public Id getCWId()
get clockwise edge of range

Specified by:
getCWId in interface IdRange
Returns:
the id at the clockwise edge of the range (exclusive)

getComplementRange

public IdRange getComplementRange()
get the complement of this range

Specified by:
getComplementRange in interface IdRange
Returns:
This range's complement

mergeRange

public IdRange mergeRange(IdRange range)
merges the given range with this range

Specified by:
mergeRange in interface IdRange
Returns:
The merge

diffRange

public IdRange diffRange(IdRange range)
diffs the given range with this range

Specified by:
diffRange in interface IdRange
Returns:
The merge

intersectRange

public IdRange intersectRange(IdRange range)
intersects the given range with this range

Specified by:
intersectRange in interface IdRange
Returns:
The merge

isEmpty

public boolean isEmpty()
returns whether or not this range is empty

Specified by:
isEmpty in interface IdRange
Returns:
Whether or not this range is empty

toString

public java.lang.String toString()
Returns a string

Overrides:
toString in class java.lang.Object
Returns:
THe string

ePOST API

Copyright © 2001-2005 - Rice Pastry.