org.jrdf.graph.index.nodepool.mem
Class NodePoolMemImpl

java.lang.Object
  extended by org.jrdf.graph.index.nodepool.mem.NodePoolMemImpl
All Implemented Interfaces:
NodePoolMem, NodePool

public final class NodePoolMemImpl
extends Object
implements NodePoolMem

Stuff goes in here.

Version:
$Id: NodePoolMemImpl.java 1045 2007-01-05 04:56:09Z newmana $
Author:
Andrew Newman

Constructor Summary
NodePoolMemImpl()
           
NodePoolMemImpl(Map<Long,Node> newNodePool, Map<String,Long> newStringPool)
           
 
Method Summary
 Long getNextNodeId()
          Returns the current next node Id increments it by one.
 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.
 Collection<Node> getNodePoolValues()
          Returns all the nodes in the node pool.
 Long[] localize(Node first, Node second, Node third)
          Converts a globalized set of triple objects to an array of longs.
 void registerNode(MemNode node)
          Adds a node that was not created by this pool but still uses the MemNode interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodePoolMemImpl

public NodePoolMemImpl()

NodePoolMemImpl

public NodePoolMemImpl(Map<Long,Node> newNodePool,
                       Map<String,Long> newStringPool)
Method Detail

getNodeById

public Node getNodeById(Long id)
Description copied from interface: NodePool
Package method to find a node in the node pool by its id.

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

getNodeIdByString

public Long getNodeIdByString(String str)
Description copied from interface: NodePool
Package method to find a node id based on its string representation.

Specified by:
getNodeIdByString in interface NodePool
Parameters:
str - The string representation of a node.
Returns:
The id of the node with the given string.

registerNode

public void registerNode(MemNode node)
Description copied from interface: NodePoolMem
Adds a node that was not created by this pool but still uses the MemNode interface.

Specified by:
registerNode in interface NodePoolMem
Parameters:
node - The node to add.

getNodePoolValues

public Collection<Node> getNodePoolValues()
Description copied from interface: NodePoolMem
Returns all the nodes in the node pool.

Specified by:
getNodePoolValues in interface NodePoolMem
Returns:
The node pool.

getNextNodeId

public Long getNextNodeId()
Description copied from interface: NodePoolMem
Returns the current next node Id increments it by one.

Specified by:
getNextNodeId in interface NodePoolMem
Returns:
the current next node Id.

localize

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

Specified by:
localize in interface NodePool
Parameters:
first - The first node.
second - The second node.
third - The last node.
Throws:
GraphException - If there was an error adding the statement.