|
|||||||||||
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(Id nodeId,
boolean alive)
Builds a new NodeHandle for a Node, only identify its Id and sets its alive flag. |
Method Summary | |
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. |
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(Id nodeId, boolean alive)
nodeId
- Id of the related Nodealive
- true if the related Node is alive. false
in other case.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 hashCode()
Object.hashCode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |