|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jcsp.net2.NodeAddress
public abstract class NodeAddress
This abstract class defines encapsulates the address of a Node within a JCSP networked system. Specific protocols must provide concrete implementations of this class to allow Node initialisation and connection. One concrete example is provided in the org.jcsp.net2.tcpip package.
Node
,
Serialized FormField Summary | |
---|---|
protected String |
address
String representation of the address |
protected String |
protocol
String representing the protocol in used |
Constructor Summary | |
---|---|
NodeAddress()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected String protocol
protected String address
Constructor Detail |
---|
public NodeAddress()
Method Detail |
---|
public String getProtocol()
public String getAddress()
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- The NodeAddress to compare to
public int compareTo(Object arg0)
compareTo
in interface Comparable
arg0
- The NodeAddress to compare to
protected 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 parse
IllegalArgumentException
- 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 installed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |