org.jrdf.parser
Interface ParserBlankNodeFactory

All Known Implementing Classes:
ParserBlankNodeFactoryImpl

public interface ParserBlankNodeFactory

A factory for creating BlankNodes. One possible implementation might create BlankNodes that maintain their identity relative to the RDF file being parsed, possibly by wrapping the nodeID in the case of createBlankNode(String) or by wrapping a sequence number in the case of createBlankNode(). In that case the resulting BlankNodes would only be useful as a temporary object that is used while an RDF file is being parsed.
Another implementation might keep a map from nodeID to BlankNode so that createBlankNode(String) would always return the same BlankNode object when called with a particular nodeID.

Version:
$Revision: 1804 $
Author:
David Makepeace

Method Summary
 void clear()
          Resets this ParserBlankNodeFactory.
 void close()
          Close any resource used by the blank node factory.
 BlankNode createBlankNode()
          Creates a BlankNode that is unique relative to this instance of the ParserBlankNodeFactory.
 BlankNode createBlankNode(String nodeID)
          Creates a BlankNode that is only distinguished by the nodeID value.
 

Method Detail

createBlankNode

BlankNode createBlankNode()
                          throws GraphElementFactoryException
Creates a BlankNode that is unique relative to this instance of the ParserBlankNodeFactory.

Returns:
the BlankNode.
Throws:
GraphElementFactoryException - if there is a failure to create the blank node.

createBlankNode

BlankNode createBlankNode(String nodeID)
                          throws GraphElementFactoryException
Creates a BlankNode that is only distinguished by the nodeID value.

Parameters:
nodeID - the nodeID of the blank node - consistently returns the same blank node if it exists.
Returns:
the BlankNode.
Throws:
GraphElementFactoryException - if there is a failure to create the blank node.

clear

void clear()
Resets this ParserBlankNodeFactory. Subsequent calls to createBlankNode() may return BlankNodes that compare equal to BlankNodes that were created before the call to clear().


close

void close()
Close any resource used by the blank node factory.