public final class NodeID extends AbstractID implements java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
A Class whose instances represent a unique identifier for a JCSP.NET Node.
For an explanation of this class, see .
AbstractID
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Returns a clone of the instance of
NodeID on which
this method is being called. |
int |
compareTo(java.lang.Object o)
Compares this
NodeID object with another
NodeID object. |
int |
compareToLocalNode()
This method is equivalent to calling the
compareTo(Object)
and supplying the local Node's NodeID as a parameter. |
boolean |
equals(java.lang.Object o)
Compares this
NodeID with another object. |
NodeAddressID[] |
getAddresses()
Returns a clone of the set of
NodeAddressID objects that
this NodeID holds. |
DomainID |
getDomainID()
Get the
DomainID of the domain to which the Node represented by
this NodeID object belongs. |
java.lang.String |
getName()
Returns a name that has been assigned to the Node
represented by this
NodeID object. |
AbstractID |
getParentID()
Returns this instance's parent
AbstractID object. |
int |
hashCode()
Returns a hash code for this
NodeID object. |
java.lang.String |
toString()
Returns a human readable
String that
represents this NodeID object. |
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
Returns a clone of the instance of NodeID on which
this method is being called.
clone in class java.lang.ObjectNodeID.java.lang.CloneNotSupportedException - if the NodeID cannot be cloned.public boolean equals(java.lang.Object o)
Compares this NodeID with another object. This will only return
true if the other object is a NodeID representing the same Node as
this NodeID. The comparison is performed by using a Node's unique
identifier. This was introduced for efficiency reasons as comparing two
NodeID objects' sets of addresses could be quite slow.
equals in class java.lang.Objecto - another object to compare with this NodeID.true iff the other object is a NodeID representing the same
Node as this NodeID.public int hashCode()
Returns a hash code for this NodeID object.
hashCode in class java.lang.Objectint hash code.public int compareTo(java.lang.Object o)
throws java.lang.ClassCastException
Compares this NodeID object with another
NodeID object. Returns 0 if this NodeID is equal
to the other NodeID, a negative int if this
NodeID is less than the supplied NodeID or a positive
int if this NodeID is greater than the supplied
NodeID.
This comparison is based upon the implementation of NodeUI used.
compareTo in interface java.lang.Comparableo - An object to compare with this NodeID.NodeID is equal
to the other NodeID, a negative int if this
NodeID is less than the supplied NodeID or a positive
int if this NodeID is greater than the supplied
NodeID.java.lang.ClassCastException - if the parameter supplied is not a NodeID.public int compareToLocalNode()
This method is equivalent to calling the compareTo(Object)
and supplying the local Node's NodeID as a parameter.
int following the rules of the
compareTo(Object) method.public NodeAddressID[] getAddresses()
Returns a clone of the set of NodeAddressID objects that
this NodeID holds.
If any held NodeAddressID objects do not support
cloning, then the actual object is returned but this should
never be the case.
NodeAddressID objects.public AbstractID getParentID()
AbstractIDAbstractID object.getParentID in class AbstractIDAbstractID of this object.public DomainID getDomainID()
DomainID of the domain to which the Node represented by
this NodeID object belongs.
If the Node is not a member of a domain then a DomainID object
will be returned that will return true when its
isNullDomain() method is called.NodeID object's DomainID object.public java.lang.String getName()
NodeID object.
If no name has been assigned, then an empty String
is returned.
The Node naming feature is not currently implemented.NodeID object's Node.public java.lang.String toString()
String that
represents this NodeID object.
This will either include the name of the Node, if assigned, or else
a list of the Node's addresses.
The String returned by this method is only really intended as a
way of supply debugging information to users. The contents is not guaranteed
and should not relied upon by a program.toString in class java.lang.ObjectString.Copyright © 1996–2022. All rights reserved.