ch.bind.philib.util
Class LruList<E extends LruNode>
java.lang.Object
ch.bind.philib.util.LruList<E>
public final class LruList<E extends LruNode>
- extends Object
|
Constructor Summary |
LruList(int capacity)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LruList
public LruList(int capacity)
add
public E add(E node)
- Add a new
LruNode to the head of the LRU.
- Parameters:
node - The new head of the LruList.
- Returns:
null if the the size after adding the new LruNode does not exceed this list's
capacity. Otherwise the list will remove the tail (the element which wasn't accessed for the
longest amount of time) and return it.
remove
public void remove(E node)
removeTail
public E removeTail()
moveToHead
public void moveToHead(E node)
clear
public void clear()
size
public int size()
capacity
public int capacity()
hasSpace
public boolean hasSpace()
Copyright © 2013. All Rights Reserved.