org.jrdf.graph.local.index.nodepool
Class LocalizerImpl

java.lang.Object
  extended by org.jrdf.graph.local.index.nodepool.LocalizerImpl
All Implemented Interfaces:
Localizer, TypedNodeVisitor

public class LocalizerImpl
extends Object
implements Localizer


Constructor Summary
LocalizerImpl(NodePool newNodePool, StringNodeMapper newMapper)
           
 
Method Summary
 BlankNode createLocalBlankNode()
           
 Literal createLocalLiteral(String escapedForm)
           
 URIReference createLocalURIReference(URI uri, boolean validate)
           
 Long localize(Node node)
          Converts a node into it's localized version.
 Long[] localize(Node first, Node second, Node third)
          Converts a globalized set of triple objects to an array of longs.
 void visitBlankNode(BlankNode blankNode)
          Visit blank node.
 void visitLiteral(Literal literal)
          Visit Literal.
 void visitNode(Node node)
          Visit node.
 void visitResource(Resource resource)
          Visit Resource.
 void visitURIReference(URIReference uriReference)
          Visit URI Reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalizerImpl

public LocalizerImpl(NodePool newNodePool,
                     StringNodeMapper newMapper)
Method Detail

localize

public Long[] localize(Node first,
                       Node second,
                       Node third)
                throws GraphException
Description copied from interface: Localizer
Converts a globalized set of triple objects to an array of longs.

Specified by:
localize in interface Localizer
Parameters:
first - The first node.
second - The second node.
third - The last node.
Returns:
an array of longs that match the given first, second and third nodes.
Throws:
GraphException - If there was an error adding the statement.

localize

public Long localize(Node node)
              throws GraphException
Description copied from interface: Localizer
Converts a node into it's localized version.

Specified by:
localize in interface Localizer
Parameters:
node - the node to localize.
Returns:
the unique node identifier.
Throws:
GraphException - if the node was not part of this node pool.

createLocalBlankNode

public BlankNode createLocalBlankNode()
                               throws GraphException
Specified by:
createLocalBlankNode in interface Localizer
Throws:
GraphException

createLocalURIReference

public URIReference createLocalURIReference(URI uri,
                                            boolean validate)
Specified by:
createLocalURIReference in interface Localizer

createLocalLiteral

public Literal createLocalLiteral(String escapedForm)
Specified by:
createLocalLiteral in interface Localizer

visitBlankNode

public void visitBlankNode(BlankNode blankNode)
Description copied from interface: TypedNodeVisitor
Visit blank node.

Specified by:
visitBlankNode in interface TypedNodeVisitor
Parameters:
blankNode - the blank node to visit.

visitURIReference

public void visitURIReference(URIReference uriReference)
Description copied from interface: TypedNodeVisitor
Visit URI Reference.

Specified by:
visitURIReference in interface TypedNodeVisitor
Parameters:
uriReference - the URI Reference to visit.

visitLiteral

public void visitLiteral(Literal literal)
Description copied from interface: TypedNodeVisitor
Visit Literal.

Specified by:
visitLiteral in interface TypedNodeVisitor
Parameters:
literal - the Literal to visit.

visitNode

public void visitNode(Node node)
Description copied from interface: TypedNodeVisitor
Visit node.

Specified by:
visitNode in interface TypedNodeVisitor
Parameters:
node - the node to visit.

visitResource

public void visitResource(Resource resource)
Description copied from interface: TypedNodeVisitor
Visit Resource.

Specified by:
visitResource in interface TypedNodeVisitor
Parameters:
resource - the node to visit.