public class LRUList
extends java.lang.Object
LRUList
defines Entry
inner class as
an object placeholder.
Entry
instances should be kept and modified,
you should not need to use
use entryForObject
method. In this case you will get
O(n) performance.Modifier and Type | Class and Description |
---|---|
class |
LRUList.Entry
Element of the LRU list.
|
Modifier and Type | Field and Description |
---|---|
protected LRUList.Entry |
head |
Constructor and Description |
---|
LRUList() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
LRUList.Entry |
entryForObject(java.lang.Object obj) |
LRUList.Entry |
getFirst() |
LRUList.Entry |
getLast() |
LRUList.Entry |
newEntry(java.lang.Object obj)
Creates new entry in the LRU list.
|
protected final LRUList.Entry head
public LRUList.Entry getFirst()
null
if the list is empty).public LRUList.Entry getLast()
null
if the list is empty).public LRUList.Entry entryForObject(java.lang.Object obj)
obj
- Objectpublic LRUList.Entry newEntry(java.lang.Object obj)
obj
- Objectpublic void clear()