org.jrdf.graph.local.index.nodepool
Interface NodePool

All Known Implementing Classes:
NodePoolImpl

public interface NodePool

Maps between the Long identifier and a Node (globalized value) or from a String to a Long (local value).

Version:
$Revision: 1835 $
Author:
Andrew Newman

Method Summary
 void clear()
          Removes all entries from the nodepool.
 ClosableIterator<BlankNode> getBlankNodeIterator()
           
 Long getNewNodeId()
          Returns a new node id.
 Node getNodeById(Long id)
          Package method to find a node in the node pool by its id.
 Long getNodeIdByString(String str)
          Package method to find a node id based on its string representation.
 List<Map<Long,String>> getNodePoolValues()
          Returns all the nodes in the node pool.
 ClosableIterator<URIReference> getURIReferenceIterator()
           
 void registerLiteral(Literal node)
           
 void registerLocalBlankNode(BlankNode node)
           
 void registerNodePoolValues(List<Map<Long,String>> values)
          Registers a large number of nodes in ones go.
 void registerURIReference(URIReference node)
           
 String removeNode(Long value)
          Remove a node from the node pool.
 

Method Detail

getNodeById

Node getNodeById(Long id)
Package method to find a node in the node pool by its id.

Parameters:
id - The id of the node to search for.
Returns:
The node referred to by the id, null if not found.

getNodeIdByString

Long getNodeIdByString(String str)
Package method to find a node id based on its string representation.

Parameters:
str - The string representation of a node.
Returns:
The id of the node with the given string.

getNodePoolValues

List<Map<Long,String>> getNodePoolValues()
Returns all the nodes in the node pool.

Returns:
The node pool.

getNewNodeId

Long getNewNodeId()
Returns a new node id.

Returns:
a new node id

clear

void clear()
Removes all entries from the nodepool.


registerNodePoolValues

void registerNodePoolValues(List<Map<Long,String>> values)
Registers a large number of nodes in ones go.

Parameters:
values - the map contains a list of longs to serialized nodes (as strings).

removeNode

String removeNode(Long value)
Remove a node from the node pool.

Parameters:
value - the value to remove.
Returns:
null if not delete or the value.

registerLocalBlankNode

void registerLocalBlankNode(BlankNode node)

registerURIReference

void registerURIReference(URIReference node)

registerLiteral

void registerLiteral(Literal node)

getBlankNodeIterator

ClosableIterator<BlankNode> getBlankNodeIterator()

getURIReferenceIterator

ClosableIterator<URIReference> getURIReferenceIterator()