|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jrdf.graph.local.index.AbstractIndex<T>
public class AbstractIndex<T>
Field Summary | |
---|---|
protected Map<T,Map<T,Set<T>>> |
index
|
Constructor Summary | |
---|---|
protected |
AbstractIndex()
|
protected |
AbstractIndex(Map<T,Map<T,Set<T>>> newIndex)
|
Method Summary | |
---|---|
void |
add(T... triple)
Adds a triple to a single index. |
void |
clear()
Removes all triples from this index. |
void |
close()
|
boolean |
contains(T node)
Returns true if the value given exists in the index. |
long |
getSize()
Returns the number of triples in the index. |
Map<T,Set<T>> |
getSubIndex(T first)
Returns the map of long to set of longs for the given entry of the index. |
Iterator<Map.Entry<T,Map<T,Set<T>>>> |
iterator()
Returns an iterator which contains all the elements in the graph as a collections of distinct longs, contains a map of longs to other longs. |
boolean |
keyExists(T node)
|
void |
remove(T... node)
Removes a triple from a single index. |
boolean |
removeSubIndex(T first)
Removes the given entry of long to set of longs with the given entry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Map<T,Map<T,Set<T>>> index
Constructor Detail |
---|
protected AbstractIndex(Map<T,Map<T,Set<T>>> newIndex)
protected AbstractIndex()
Method Detail |
---|
public void add(T... triple)
Index
add
in interface Index<T>
triple
- The nodes to add.public boolean contains(T node)
Index
contains
in interface Index<T>
node
- the key to search for.
public Iterator<Map.Entry<T,Map<T,Set<T>>>> iterator()
Index
iterator
in interface Index<T>
public void remove(T... node) throws GraphException
Index
remove
in interface Index<T>
node
- the nodes to remove.
GraphException
- If there was an error revoking the statement, for example if it didn't exist.public boolean keyExists(T node)
public Map<T,Set<T>> getSubIndex(T first)
Index
getSubIndex
in interface Index<T>
first
- the entry set to find.
public boolean removeSubIndex(T first)
Index
removeSubIndex
in interface Index<T>
first
- the entry set to remove.
public void clear()
Index
clear
in interface Index<T>
public void close()
close
in interface Index<T>
public long getSize()
Index
getSize
in interface Index<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |