org.jrdf.graph.mem
Class BlankNodeImpl

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

public class BlankNodeImpl
extends AbstractBlankNode
implements MemNode

RDF blank node. Note that blank nodes are deliberately devoid of external indentifying attributes. Blank nodes, can either be subjects or objects.

Version:
$Revision: 1.1 $
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
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
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)

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