story.dbcore.nodes
Class NodeAddress

java.lang.Object
  extended by story.dbcore.nodes.NodeAddress
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class NodeAddress
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

A reference to a GenericNode. Objects of this class can be passed outside the Document to allow calling classes to more conveniently reference a node than specifying the repository and the ID, and more safely then giving them the actual GenericNode object. Instances of this class are static. If the GenericNode is renamed, this address will not reflect the new name. A NodeAddress is simply an address in a Document and is not "tied" to an actual GenericNode. A NodeAddress can be publicly constructed, and there is no guarantee a node resides at the address. See NodeProxy.

See Also:
Serialized Form

Constructor Summary
NodeAddress(GenericNode node)
          Constructor takes a GenericNode; hence, no one above a Document should be able to construct one of these.
NodeAddress(NodeRepositoryID nr, NodeID id)
          Constructor takes address coordinates manually.
NodeAddress(NodeRepositoryID nr, java.lang.String id)
           
NodeAddress(java.lang.String nr, NodeID id)
           
NodeAddress(java.lang.String nr, java.lang.String id)
          Another constructor that takes address coordinates manually.
 
Method Summary
 int compareTo(java.lang.Object other)
           
 boolean equals(NodeAddress other)
          Test the equality of one NodeAddress to another.
 NodeID getNodeID()
          Accessor for node ID
 NodeRepositoryID getNodeRepositoryID()
          Accessor for node repository
 NodeAddress makeCopy()
           
 java.lang.StringBuffer render()
          Render the node address in the syntax interpretable by the command interpreter.
 java.lang.String toString()
          Render the node address in the syntax interpretable by the command interpreter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeAddress

public NodeAddress(GenericNode node)
            throws Scheherexception
Constructor takes a GenericNode; hence, no one above a Document should be able to construct one of these.

Throws:
Scheherexception

NodeAddress

public NodeAddress(NodeRepositoryID nr,
                   NodeID id)
Constructor takes address coordinates manually. Used to construct addresses regardless of whether a corresponding node actually exists.


NodeAddress

public NodeAddress(java.lang.String nr,
                   java.lang.String id)
            throws Scheherexception
Another constructor that takes address coordinates manually. Used to construct addresses regardless of whether a corresponding node actually exists.

Throws:
Scheherexception

NodeAddress

public NodeAddress(NodeRepositoryID nr,
                   java.lang.String id)
            throws Scheherexception
Throws:
Scheherexception

NodeAddress

public NodeAddress(java.lang.String nr,
                   NodeID id)
            throws Scheherexception
Throws:
Scheherexception
Method Detail

getNodeRepositoryID

public NodeRepositoryID getNodeRepositoryID()
Accessor for node repository


getNodeID

public NodeID getNodeID()
Accessor for node ID


render

public java.lang.StringBuffer render()
Render the node address in the syntax interpretable by the command interpreter.


toString

public java.lang.String toString()
Render the node address in the syntax interpretable by the command interpreter.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(NodeAddress other)
               throws Scheherexception
Test the equality of one NodeAddress to another.

Throws:
Scheherexception

compareTo

public int compareTo(java.lang.Object other)
              throws java.lang.ClassCastException
Specified by:
compareTo in interface java.lang.Comparable
Throws:
java.lang.ClassCastException

makeCopy

public NodeAddress makeCopy()


Copyright © 2011 David K. Elson. All Rights Reserved.