org.jrdf.graph.local.mem
Class BlankNodeImpl

java.lang.Object
  extended by org.jrdf.graph.AbstractBlankNode
      extended by org.jrdf.graph.local.mem.BlankNodeImpl
All Implemented Interfaces:
Serializable, BlankNode, GlobalizedBlankNode, LocalizedNode, Node, ObjectNode, SubjectNode, TypedNodeVisitable

public class BlankNodeImpl
extends AbstractBlankNode
implements GlobalizedBlankNode

RDF blank node. Note that blank nodes are deliberately devoid of external indentifying attributes.

Blank nodes, can either be subjects or objects.

Version:
$Revision: 1822 $
Author:
Paul Gearon
See Also:
Serialized Form

Constructor Summary
BlankNodeImpl(String newUid, Long newId)
          The constructor for this node.
 
Method Summary
 boolean equals(Object obj)
          While the internal structure of a BlankNode is not defined equality between two nodes should be able to be determined.
 Long getId()
          Retrieves an internal identifier for this node.
 String getUID()
          Retrieves a Globally Unique Identifier for this node.
 int hashCode()
          Returns a hash-code value for this BlankNode.
 String toString()
          Returns the String value of this BlankNode as: uid#id (eg. 29fbf7ba364f1425dda058737d764603#69)
static BlankNode valueOf(String nodeString)
          Parses a String in the format of: uid#id (eg. 29fbf7ba364f1425dda058737d764603#69) and creates a new BlankNodeImpl from it.
 
Methods inherited from class org.jrdf.graph.AbstractBlankNode
accept, isBlankNode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jrdf.graph.TypedNodeVisitable
accept
 

Constructor Detail

BlankNodeImpl

public BlankNodeImpl(String newUid,
                     Long newId)
The constructor for this node. Package scope so that only NodeFactory and static methods can call it.

Parameters:
newUid - String Globally Unique Identifier for external communication.
newId - The id to be used for this node.
Method Detail

getId

public Long getId()
Retrieves an internal identifier for this node.

Specified by:
getId in interface LocalizedNode
Returns:
A numeric identifier for thisa node.

getUID

public String getUID()
Retrieves a Globally Unique Identifier for this node.

Specified by:
getUID in interface GlobalizedBlankNode
Returns:
A global String identifier for this node.

hashCode

public int hashCode()
Returns a hash-code value for this BlankNode. While the implementation is not defined, if there is a blank node identifier then it should be the hash code generated from this. Hash code generation should follow the normal contract.

Specified by:
hashCode in interface BlankNode
Overrides:
hashCode in class Object
Returns:
a hash-code value for this blank node.

equals

public boolean equals(Object obj)
While the internal structure of a BlankNode is not defined equality between two nodes should be able to be determined.

Specified by:
equals in interface BlankNode
Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

toString

public String toString()
Returns the String value of this BlankNode as: uid#id (eg. 29fbf7ba364f1425dda058737d764603#69)

Overrides:
toString in class Object
Returns:
String

valueOf

public static BlankNode valueOf(String nodeString)
                         throws IllegalArgumentException
Parses a String in the format of: uid#id (eg. 29fbf7ba364f1425dda058737d764603#69) and creates a new BlankNodeImpl from it.

Should only be applied to a value previously returned by toString()

Parameters:
nodeString - String previously returned by toString()
Returns:
BlankNodeImpl
Throws:
IllegalArgumentException