public abstract class NodeAddress
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable
Node
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected java.lang.String |
address
String representation of the address
|
private static java.util.Hashtable |
installedProtocols
The table of installed protocols on this Node
|
protected java.lang.String |
protocol
String representing the protocol in used
|
Constructor and Description |
---|
NodeAddress() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object arg0)
Compares this NodeAddress to another
|
protected abstract Link |
createLink()
Creates a Link connected to this address
|
protected abstract LinkServer |
createLinkServer()
Creates a LinkServer listening on this address
|
boolean |
equals(java.lang.Object obj)
Checks if this NodeAddress is equal to another
|
java.lang.String |
getAddress()
Gets a string representing the address
|
java.lang.String |
getProtocol()
Gets the string representing the protocol
|
protected abstract ProtocolID |
getProtocolID()
Retrieves the correct protocol handler for the implemented address type.
|
int |
hashCode()
Gets the hash code of this object
|
static void |
installProtocol(java.lang.String name,
ProtocolID protocol)
Installs a new Protocol on the Node
|
static NodeAddress |
parse(java.lang.String str)
Parses a string representation of a NodeAddress back to its object form
|
java.lang.String |
toString()
Converts the NodeAddress into a String.
|
protected java.lang.String protocol
protected java.lang.String address
private static java.util.Hashtable installedProtocols
public java.lang.String getProtocol()
public java.lang.String getAddress()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The NodeAddress to compare topublic int compareTo(java.lang.Object arg0)
compareTo
in interface java.lang.Comparable
arg0
- The NodeAddress to compare toprotected abstract Link createLink() throws JCSPNetworkException
JCSPNetworkException
- If something goes wrong during the creation of the Linkprotected abstract LinkServer createLinkServer() throws JCSPNetworkException
JCSPNetworkException
- If something goes wrong during the creation of the LinkServerprotected abstract ProtocolID getProtocolID()
public static NodeAddress parse(java.lang.String str) throws java.lang.IllegalArgumentException
str
- The string to parsejava.lang.IllegalArgumentException
- Thrown if the string is not for a recognised protocol.public static void installProtocol(java.lang.String name, ProtocolID protocol)
name
- Name of the protocol to installprotocol
- ProtocolID installed