org.jrdf.graph.mem
Class BlankNodeImpl

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

public class BlankNodeImpl
extends AbstractBlankNode
implements MemNode, Serializable

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

Blank nodes, can either be subjects or objects.

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

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.
 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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getId

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

Specified by:
getId in interface MemNode
Returns:
A numeric identifier for thisa 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