public abstract class NodeAddress extends Object implements Serializable, Comparable
Node,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected String |
address
String representation of the address
|
protected String |
protocol
String representing the protocol in used
|
| Constructor and Description |
|---|
NodeAddress() |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(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(Object obj)
Checks if this NodeAddress is equal to another
|
String |
getAddress()
Gets a string representing the address
|
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(String name,
ProtocolID protocol)
Installs a new Protocol on the Node
|
static NodeAddress |
parse(String str)
Parses a string representation of a NodeAddress back to its object form
|
String |
toString()
Converts the NodeAddress into a String.
|
protected String protocol
protected String address
public String getProtocol()
public String getAddress()
public String toString()
public int hashCode()
public boolean equals(Object obj)
public int compareTo(Object arg0)
compareTo in interface Comparablearg0 - 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(String str) throws IllegalArgumentException
str - The string to parseIllegalArgumentException - Thrown if the string is not for a recognised protocol.public static void installProtocol(String name, ProtocolID protocol)
name - Name of the protocol to installprotocol - ProtocolID installedCopyright © 1996–2015. All rights reserved.