public final class NodeID
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private NodeAddress |
address
Address of the Node
|
private int |
hashCode
Hash code of a object
|
private long |
mem
Current amount of free memory to the JVM
|
private java.lang.String |
name
Name of the Node
|
private static long |
serialVersionUID
The SUID of this class
|
private long |
time
Current time in milliseconds
|
| Constructor and Description |
|---|
NodeID(long long1,
long long2,
int int1,
java.lang.String nodeName,
NodeAddress nodeAddress)
Constructor taking the full details for a remote Node connection
|
NodeID(java.lang.String nodeName,
NodeAddress nodeAddress)
Constructor taking the name and the address of the Node
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(java.lang.Object arg0)
Compares this NodeID with another NodeID.
|
boolean |
equals(java.lang.Object arg0)
Checks if the given object is equal to this NodeID
|
NodeAddress |
getNodeAddress()
Gets the NodeAddress part of the NodeID
|
int |
hashCode()
Returns the hashCode for this object
|
static NodeID |
parse(java.lang.String str)
Converts a string representation of a NodeID back to a NodeID object
|
java.lang.String |
toString()
Converts the NodeID into a string for communication with other implementations, or for display purposes.
|
private static final long serialVersionUID
private final long time
private final long mem
private final int hashCode
private final java.lang.String name
private final NodeAddress address
NodeID(java.lang.String nodeName,
NodeAddress nodeAddress)
nodeName - Symbolic name of the NodenodeAddress - Symbolic address of the Nodepublic NodeID(long long1,
long long2,
int int1,
java.lang.String nodeName,
NodeAddress nodeAddress)
long1 - The time component of the remote Nodelong2 - The memory component of the remote Nodeint1 - The hashCode component of the remote NodenodeName - The name component of the remote NodenodeAddress - The NodeAddress component of the remote Nodepublic int compareTo(java.lang.Object arg0)
compareTo in interface java.lang.Comparablearg0 - public boolean equals(java.lang.Object arg0)
equals in class java.lang.Objectarg0 - public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic NodeAddress getNodeAddress()
public static NodeID parse(java.lang.String str)
str - The string version of a NodeID