|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hp.hpl.jena.graph.NodeCache
public class NodeCache
A NodeCache caches nodes according to their labels, to reduce store turnover at the expense of some additional computation. The cache is represented as an array indexed by the reduced hashcode of the labels of the nodes it contains. Only the most recent node with any given reduced hash is kept. This tactic means that we don't need to have any explicit cache-clearing code in normal oepration.
Constructor Summary | |
---|---|
NodeCache()
|
Method Summary | |
---|---|
void |
clear()
Wipe the cache of all entries. |
Node |
get(java.lang.Object label)
Answer the node with the given label in the cache, or
null if there isn't one. |
void |
put(java.lang.Object label,
Node cached)
Record in the cache the designated Node, using the given label (which must be .equals() to the Node's label). |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NodeCache()
Method Detail |
---|
public void clear()
public int size()
public Node get(java.lang.Object label)
label
in the cache, or
null
if there isn't one. Selects the slot in the cache by the
reduced hash of the label, and confirms that the Node is the right one using
.equals() on this label and that node's label.
public void put(java.lang.Object label, Node cached)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |