org.openrdf.model.impl
Class BNodeImpl

java.lang.Object
  extended by org.openrdf.model.impl.BNodeImpl
All Implemented Interfaces:
Serializable, BNode, Resource, Value
Direct Known Subclasses:
MemBNode, NativeBNode

public class BNodeImpl
extends Object
implements BNode

An implementation of the BNode interface.

Author:
Arjohn Kampman
See Also:
Serialized Form

Constructor Summary
protected BNodeImpl()
          Creates a new, unitialized blank node.
  BNodeImpl(String id)
          Creates a new blank node with the supplied identifier.
 
Method Summary
 boolean equals(Object o)
          Compares a blank node object to another object.
 String getID()
          retrieves this blank node's identifier.
 int hashCode()
          The hash code of a blank node is defined as the hash code of its identifier: id.hashCode().
protected  void setID(String id)
           
 String stringValue()
          Returns the String-value of a Value object.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BNodeImpl

protected BNodeImpl()
Creates a new, unitialized blank node. This blank node's ID needs to be set before the normal methods can be used.


BNodeImpl

public BNodeImpl(String id)
Creates a new blank node with the supplied identifier.

Parameters:
id - The identifier for this blank node, must not be null.
Method Detail

getID

public String getID()
Description copied from interface: BNode
retrieves this blank node's identifier.

Specified by:
getID in interface BNode
Returns:
A blank node identifier.

setID

protected void setID(String id)

stringValue

public String stringValue()
Description copied from interface: Value
Returns the String-value of a Value object. This returns either a Literal's label, a URI's URI or a BNode's ID.

Specified by:
stringValue in interface Value

equals

public boolean equals(Object o)
Description copied from interface: BNode
Compares a blank node object to another object.

Specified by:
equals in interface BNode
Overrides:
equals in class Object
Parameters:
o - The object to compare this blank node to.
Returns:
true if the other object is an instance of BNode and their IDs are equal, false otherwise.

hashCode

public int hashCode()
Description copied from interface: BNode
The hash code of a blank node is defined as the hash code of its identifier: id.hashCode().

Specified by:
hashCode in interface BNode
Overrides:
hashCode in class Object
Returns:
A hash code for the blank node.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2008 Aduna. All Rights Reserved.