org.jrdf.graph.global.index
Class AbstractMoleculeIndexMem

java.lang.Object
  extended by org.jrdf.graph.global.index.AbstractMoleculeIndexMem
All Implemented Interfaces:
Serializable, MoleculeIndex
Direct Known Subclasses:
OSPMoleculeIndexMem, POSMoleculeIndexMem, SPOMoleculeIndexMem

public abstract class AbstractMoleculeIndexMem
extends Object
implements MoleculeIndex, Serializable

See Also:
Serialized Form

Constructor Summary
protected AbstractMoleculeIndexMem()
           
protected AbstractMoleculeIndexMem(Map<Node,Map<Node,Map<Node,Molecule>>> newIndex)
           
 
Method Summary
 void add(Node first, Node second, Node third, Molecule molecule)
           
 void clear()
           
 boolean contains(Node node)
           
 Molecule getMolecule(Triple headTriple)
           
protected abstract  Node[] getNodes(Triple triple)
           
 long getNumberOfMolecules()
           
 long getNumberOfTriples()
           
 Map<Node,Map<Node,Molecule>> getSubIndex(Node first)
           
 Iterator<Map.Entry<Node,Map<Node,Map<Node,Molecule>>>> keySetIterator()
           
 void remove(Molecule molecule)
           
 void remove(Node[] nodes)
           
 void remove(Node first, Node second, Node third)
           
 boolean removeSubIndex(Node first)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractMoleculeIndexMem

protected AbstractMoleculeIndexMem()

AbstractMoleculeIndexMem

protected AbstractMoleculeIndexMem(Map<Node,Map<Node,Map<Node,Molecule>>> newIndex)
Method Detail

add

public void add(Node first,
                Node second,
                Node third,
                Molecule molecule)
Specified by:
add in interface MoleculeIndex

getNodes

protected abstract Node[] getNodes(Triple triple)

remove

public void remove(Node first,
                   Node second,
                   Node third)
            throws GraphException
Specified by:
remove in interface MoleculeIndex
Throws:
GraphException

remove

public void remove(Molecule molecule)
            throws GraphException
Specified by:
remove in interface MoleculeIndex
Throws:
GraphException

remove

public void remove(Node[] nodes)
            throws GraphException
Throws:
GraphException

clear

public void clear()
Specified by:
clear in interface MoleculeIndex

contains

public boolean contains(Node node)
Specified by:
contains in interface MoleculeIndex

getMolecule

public Molecule getMolecule(Triple headTriple)
Specified by:
getMolecule in interface MoleculeIndex

getNumberOfTriples

public long getNumberOfTriples()
Specified by:
getNumberOfTriples in interface MoleculeIndex

getNumberOfMolecules

public long getNumberOfMolecules()
Specified by:
getNumberOfMolecules in interface MoleculeIndex

getSubIndex

public Map<Node,Map<Node,Molecule>> getSubIndex(Node first)
Specified by:
getSubIndex in interface MoleculeIndex

removeSubIndex

public boolean removeSubIndex(Node first)
Specified by:
removeSubIndex in interface MoleculeIndex

keySetIterator

public Iterator<Map.Entry<Node,Map<Node,Map<Node,Molecule>>>> keySetIterator()
Specified by:
keySetIterator in interface MoleculeIndex

toString

public String toString()
Overrides:
toString in class Object