|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.cache.eviction.MRUQueue
public class MRUQueue
MRU Eviction Queue implementation.
This nodeMap is sorted by MRU. The first entry in the nodeMap will also be the most recently used entry. The sort is implicit based on a Stack that we can implicitly sort to the top by moving a node that is used to the top of the eviction stack.
Constructor Summary | |
---|---|
protected |
MRUQueue()
|
Method Summary | |
---|---|
void |
addNodeEntry(NodeEntry entry)
Add a NodeEntry to the queue. |
void |
clear()
Clear the queue. |
boolean |
containsNodeEntry(NodeEntry entry)
Check if queue contains the given NodeEntry. |
NodeEntry |
getFirstNodeEntry()
Will return the first entry in the nodeMap. |
NodeEntry |
getNodeEntry(Fqn fqn)
Retrieve a node entry by Fqn. |
NodeEntry |
getNodeEntry(String fqn)
|
int |
getNumberOfElements()
Get the number of elements in the queue. |
int |
getNumberOfNodes()
Get the number of nodes in the queue. |
Iterator<NodeEntry> |
iterator()
|
void |
modifyElementCount(int difference)
|
protected void |
moveToTopOfStack(Fqn fqn)
This call moves a NodeEntry to the top of the stack. |
void |
removeNodeEntry(NodeEntry entry)
Remove a NodeEntry from queue. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected MRUQueue()
Method Detail |
---|
protected void moveToTopOfStack(Fqn fqn)
fqn
- Fqn of the nodeEntry to move to the top of the stack.public NodeEntry getFirstNodeEntry()
getFirstNodeEntry
in interface EvictionQueue
public NodeEntry getNodeEntry(Fqn fqn)
EvictionQueue
getNodeEntry
in interface EvictionQueue
fqn
- Fqn of the node entry to retrieve.
public NodeEntry getNodeEntry(String fqn)
getNodeEntry
in interface EvictionQueue
public boolean containsNodeEntry(NodeEntry entry)
EvictionQueue
containsNodeEntry
in interface EvictionQueue
entry
- NodeEntry to check for existence in queue.
public void removeNodeEntry(NodeEntry entry)
EvictionQueue
removeNodeEntry
in interface EvictionQueue
entry
- The NodeEntry to remove from queue.public void addNodeEntry(NodeEntry entry)
EvictionQueue
addNodeEntry
in interface EvictionQueue
entry
- The NodeEntry to add to queue.public int getNumberOfNodes()
EvictionQueue
getNumberOfNodes
in interface EvictionQueue
public int getNumberOfElements()
EvictionQueue
getNumberOfElements
in interface EvictionQueue
public void modifyElementCount(int difference)
modifyElementCount
in interface EvictionQueue
public void clear()
EvictionQueue
clear
in interface EvictionQueue
public Iterator<NodeEntry> iterator()
iterator
in interface Iterable<NodeEntry>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |