|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanet.commonapi.Id
This interface is an abstraction of an Id (or key) from the CommonAPI paper.
Any class that extends this Id for a specific overlay, must to offer
all theese constructors, based with its argument list:
InitializationException
,
Serialized FormConstructor Summary | |
Id()
|
Method Summary | |
abstract Id |
add(Id offset)
Returns an Id corresponding to this Id plus a given distance |
abstract boolean |
between(Id ccw,
Id cw)
Checks if this Id is between two given ids ccw (inclusive) and cw (exclusive) on the circle |
boolean |
betweenE(Id init,
Id end)
Checks if this Id is in interval (init,end] |
abstract boolean |
clockwise(Id nid)
Checks to see if the Id nid is clockwise or counterclockwise from this, on the ring. |
boolean |
Ebetween(Id init,
Id end)
Checks if this Id is in interval [init,end) |
static Id |
getMaximum()
This method returns the maximum value for an Id that is possible to build. |
abstract java.lang.Object |
getValue()
Returns the internal representation value of this Id. |
void |
setValue(Id newValue)
Sets the new value with Id newValue. |
abstract void |
setValue(java.lang.Object newValue)
Sets the new value to this Id with newValue |
abstract Id |
shift(int cnt,
int fill)
Shift operator. shift(-1,0) multiplies value of this by two, shift(1,0) divides by 2 |
abstract Id |
subtract(Id offset)
Returns an Id corresponding to this Id minus a given distance |
abstract byte[] |
toByteArray()
Returns a (mutable) byte array representing this Id |
abstract java.lang.String |
toStringFull()
Returns a string representing the full length of this Id. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Comparable |
compareTo |
Constructor Detail |
public Id()
Method Detail |
public abstract boolean between(Id ccw, Id cw)
ccw
- the counterclockwise idcw
- the clockwise id
public boolean Ebetween(Id init, Id end)
init
- Id that open the interval
public boolean betweenE(Id init, Id end)
init
- Id that open the interval
public abstract boolean clockwise(Id nid)
nid
- The id to compare to
public abstract Id add(Id offset)
offset
- the distance to add
public abstract Id subtract(Id offset)
offset
- the distance to subtract
public abstract Id shift(int cnt, int fill)
cnt
- the number of bits to shift, negative shifts left, positive shifts rightfill
- value of bit shifted in (0 if fill == 0, 1 otherwise)
public abstract byte[] toByteArray()
public abstract java.lang.String toStringFull()
public void setValue(Id newValue)
newValue
- Id with the new value.setValue(planet.commonapi.Id)
public abstract void setValue(java.lang.Object newValue)
newValue
- Internal representation with the new value
to set to this Id.public abstract java.lang.Object getValue()
public static Id getMaximum()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |