|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeer2me.domain.Node
This class represents a node in the network. It contains information like the name of the node and its network address. A node also owns a nodeConnection object listening for- and processing incoming and outgoing data packages.
Constructor Summary | |
Node(java.lang.String address,
javax.microedition.io.StreamConnection connection)
Constructor. |
|
Node(java.lang.String nodeName,
java.lang.String address)
Constructor. |
|
Node(java.lang.String nodeName,
java.lang.String address,
javax.microedition.io.StreamConnection connection)
Constructor. |
Method Summary | |
java.lang.String |
getAddress()
This method returns the node address |
NodeConnection |
getNodeConnection()
This method returns the NodeConnection owned by this node |
java.lang.String |
getNodeName()
This method returns the name of the node |
static Node |
restoreNode(java.lang.String nodeString)
This method restores a node with the properties specified in the given input string. |
void |
setNodeConnection(javax.microedition.io.StreamConnection connection)
This method sets the connection to this remote node. |
void |
setNodeName(java.lang.String nodeName)
This method sets the name of the node |
void |
startNodeConnection()
This method creates a nodeConnection running two threads. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Node(java.lang.String nodeName, java.lang.String address)
nodeName
- The name of the nodeaddress
- The node network addresspublic Node(java.lang.String nodeName, java.lang.String address, javax.microedition.io.StreamConnection connection)
nodeName
- The name of the nodeaddress
- The node network addressconnection
- The connection to this remote nodepublic Node(java.lang.String address, javax.microedition.io.StreamConnection connection)
address
- The node network addressconnection
- The connection to this remote nodeMethod Detail |
public void startNodeConnection()
public NodeConnection getNodeConnection()
public void setNodeConnection(javax.microedition.io.StreamConnection connection)
connection
- The connection to this remote nodepublic java.lang.String getNodeName()
public void setNodeName(java.lang.String nodeName)
nodeName
- The name of the nodepublic java.lang.String getAddress()
public static Node restoreNode(java.lang.String nodeString)
nodeString
- A string containing node properties (name:address)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |