org.jrdf.graph.local.index.graphhandler
Class GraphHandler201

java.lang.Object
  extended by org.jrdf.graph.local.index.graphhandler.AbstractGraphHandler
      extended by org.jrdf.graph.local.index.graphhandler.GraphHandler201
All Implemented Interfaces:
GraphHandler

public class GraphHandler201
extends AbstractGraphHandler
implements GraphHandler

Handles operations on 201 index.

Version:
$Revision: 1815 $
Author:
Andrew Newman

Field Summary
 
Fields inherited from class org.jrdf.graph.local.index.graphhandler.AbstractGraphHandler
nodePool
 
Constructor Summary
GraphHandler201(LongIndex[] indexes, NodePool nodePool)
           
 
Method Summary
 Triple createTriple(Long... nodes)
          Creates the globalized nodes based on the internal representation of the nodes.
 Iterator<Map.Entry<Long,Map<Long,Set<Long>>>> getEntries()
          Returns an iterator over an internal representation of the graph in the fixed order based on the underlying index.
 Map<Long,Set<Long>> getSubIndex(Long first)
          Returns the map of long to set of longs for the given entry of the index.
 void remove(Long... currentNodes)
          Removes a triple from the other indexes of the graph.
 boolean removeSubIndex(Long first)
          Removes the given entry of long to set of longs with the given entry.
 
Methods inherited from class org.jrdf.graph.local.index.graphhandler.AbstractGraphHandler
dumpIndex, reconstructIndices
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jrdf.graph.local.index.graphhandler.GraphHandler
reconstructIndices
 

Constructor Detail

GraphHandler201

public GraphHandler201(LongIndex[] indexes,
                       NodePool nodePool)
Method Detail

getSubIndex

public Map<Long,Set<Long>> getSubIndex(Long first)
Description copied from interface: GraphHandler
Returns the map of long to set of longs for the given entry of the index. For example, a given subject id is given and it returns a map of predicates to objects.

Specified by:
getSubIndex in interface GraphHandler
Parameters:
first - the entry set to find.
Returns:
a map containing the list of longs to set of longs.

removeSubIndex

public boolean removeSubIndex(Long first)
Description copied from interface: GraphHandler
Removes the given entry of long to set of longs with the given entry. For example, a given subject id is given and it will remove all the associated predicate and objects for that subject.

Specified by:
removeSubIndex in interface GraphHandler
Parameters:
first - the entry set to remove.
Returns:
true if the entry set was non-null.

getEntries

public Iterator<Map.Entry<Long,Map<Long,Set<Long>>>> getEntries()
Description copied from interface: GraphHandler
Returns an iterator over an internal representation of the graph in the fixed order based on the underlying index.

Specified by:
getEntries in interface GraphHandler
Returns:
an iterator over an internal representation of the graph in the fixed order based on the underlying index.

createTriple

public Triple createTriple(Long... nodes)
Description copied from interface: GraphHandler
Creates the globalized nodes based on the internal representation of the nodes. This may move to the NodePool interface.

Specified by:
createTriple in interface GraphHandler
Parameters:
nodes - an array of three triple values to create.
Returns:
an array of three nodes.

remove

public void remove(Long... currentNodes)
            throws GraphException
Description copied from interface: GraphHandler
Removes a triple from the other indexes of the graph. For example, if this is the 012 GraphHandler it will remove the 120 and 201.

Specified by:
remove in interface GraphHandler
Parameters:
currentNodes - the array of nodes to remove.
Throws:
GraphException - if the nodes do not exist.