public class LRUCacheEnumerator
extends java.lang.Object
implements java.util.Enumeration
LRUCacheEnumerator returns its elements in
the order they are found in the LRUCache, with the
most recent elements first.
Once the enumerator is created, elements which are later added
to the cache are not returned by the enumerator. However,
elements returned from the enumerator could have been closed
by the cache.| Modifier and Type | Class and Description |
|---|---|
static class |
LRUCacheEnumerator.LRUEnumeratorElement |
| Modifier and Type | Field and Description |
|---|---|
protected LRUCacheEnumerator.LRUEnumeratorElement |
elementQueue
Current element;
|
| Constructor and Description |
|---|
LRUCacheEnumerator(LRUCacheEnumerator.LRUEnumeratorElement firstElement)
Creates a CacheEnumerator on the list of
LRUEnumeratorElements. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasMoreElements()
Returns true if more elements exist.
|
java.lang.Object |
nextElement()
Returns the next element.
|
protected LRUCacheEnumerator.LRUEnumeratorElement elementQueue
public LRUCacheEnumerator(LRUCacheEnumerator.LRUEnumeratorElement firstElement)
LRUEnumeratorElements.public boolean hasMoreElements()
hasMoreElements in interface java.util.Enumerationpublic java.lang.Object nextElement()
nextElement in interface java.util.Enumeration