ch.bind.philib.util
Class LruList<E extends LruNode>

java.lang.Object
  extended by ch.bind.philib.util.LruList<E>

public final class LruList<E extends LruNode>
extends Object


Constructor Summary
LruList(int capacity)
           
 
Method Summary
 E add(E node)
          Add a new LruNode to the head of the LRU.
 int capacity()
           
 void clear()
           
 boolean hasSpace()
           
 void moveToHead(E node)
           
 void remove(E node)
           
 E removeTail()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LruList

public LruList(int capacity)
Method Detail

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.