|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
planet.commonapi.NodeHandle
planet.generic.commonapi.NodeHandleImpl
NodeHandle for node. Being so simple his API, surely will be able to be reused for different nodes. It only mantain the Node Id and a flag that informs if the related Node is alive.
Field Summary |
Fields inherited from class planet.commonapi.NodeHandle |
DECLARED_DEAD, DECLARED_LIVE, PROXIMITY_CHANGED |
Constructor Summary | |
NodeHandleImpl()
|
Method Summary | |
int |
compareTo(java.lang.Object obj)
Returns less than, equals than or greater than zero if this Id is less than, equals than or greater than obj Id. |
boolean |
equals(java.lang.Object obj)
Overwrites this method to reflect the comparison between the related Id's. |
Id |
getId()
Gets the Id of the related node |
int |
getProximity()
Always returns one as proximity between any two nodes. |
int |
hashCode()
Overwrites this method to reflect the hash code of the related Id. |
boolean |
isAlive()
Inform if the related node is alive. |
void |
setAlive(boolean alive)
Updates the alive flag. |
NodeHandle |
setValues(Id newValue)
Sets the 'newValue' Id and the flag alive to true. |
NodeHandle |
setValues(Id newValue,
boolean alive)
Sets the values for this NodeHandle. |
java.lang.String |
toString()
Returns the String representation of this NodeHandle |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NodeHandleImpl()
Method Detail |
public Id getId()
getId
in class NodeHandle
NodeHandle.getId()
public boolean isAlive()
isAlive
in class NodeHandle
NodeHandle.isAlive()
public void setAlive(boolean alive)
setAlive
in class NodeHandle
alive
- New value for the alive flag.NodeHandle.setAlive(boolean)
public java.lang.String toString()
Object.toString()
public int getProximity()
getProximity
in class NodeHandle
NodeHandle.getProximity()
public boolean equals(java.lang.Object obj)
obj
- NodeHandle to be compared.
Object.equals(java.lang.Object)
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
obj
- Another NodeHandle
Comparable.compareTo(java.lang.Object)
public int hashCode()
Object.hashCode()
public NodeHandle setValues(Id newValue)
setValues
in class NodeHandle
newValue
- New Id.
NodeHandle.setValues(planet.commonapi.Id)
public NodeHandle setValues(Id newValue, boolean alive)
setValues
in class NodeHandle
newValue
- The new Idalive
- If the NodeHandle is alive
NodeHandle.setValues(planet.commonapi.Id, boolean)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |