org.openrdf.model.impl
Class BNodeImpl

java.lang.Object
  extended byorg.openrdf.model.impl.BNodeImpl
All Implemented Interfaces:
BNode, Comparable, Resource, Serializable, Value
Direct Known Subclasses:
BNodeNode, IdBNode, NativeBNode

public class BNodeImpl
extends Object
implements BNode, Serializable

An implementation of the BNode interface.

See Also:
Serialized Form

Constructor Summary
BNodeImpl(String id)
           
 
Method Summary
 void addProperty(URI property, Value value)
          Adds a property to this Resource in the RDF graph.
 int compareTo(Object other)
          Compares this BNode with the supplied object.
 boolean equals(Object o)
          Compares a blank node object to another object.
 String getID()
          retrieves this bNode's identifier.
 StatementIterator getObjectStatements()
          Gets all statements from the RDF graph for which this value is the object.
 StatementIterator getSubjectStatements()
          Gets all statements from the RDF graph for which this resource is the subject.
 int hashCode()
          The hash code of a blank node is defined as the hash code of its identifier: id.hashCode().
 String toString()
          Returns the BNode's string representation.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BNodeImpl

public BNodeImpl(String id)
Method Detail

getID

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

Specified by:
getID in interface BNode
Returns:
a bnode identifier

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

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

compareTo

public int compareTo(Object other)
Compares this BNode with the supplied object.

Specified by:
compareTo in interface Comparable
Throws:
ClassCastException - if o is not of type BNode
See Also:
Comparable

toString

public String toString()
Returns the BNode's string representation.


addProperty

public void addProperty(URI property,
                        Value value)
                 throws GraphException
Description copied from interface: Resource
Adds a property to this Resource in the RDF graph. The result is that a statement of the form (this, property, value) is added.

Specified by:
addProperty in interface Resource
Parameters:
property - the predicate of the statement that should be added.
value - the value of the statements that should be added.
Throws:
GraphException

getSubjectStatements

public StatementIterator getSubjectStatements()
                                       throws GraphException
Description copied from interface: Resource
Gets all statements from the RDF graph for which this resource is the subject.

Specified by:
getSubjectStatements in interface Resource
Throws:
GraphException

getObjectStatements

public StatementIterator getObjectStatements()
                                      throws GraphException
Description copied from interface: Value
Gets all statements from the RDF graph for which this value is the object.

Specified by:
getObjectStatements in interface Value
Throws:
GraphException


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.