E - Type contained in the listpublic class EvictingList<E>
extends java.util.LinkedList<E>
| Constructor and Description |
|---|
EvictingList(int limit)
A new EvictingList with the specified size limit
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E o) |
E |
getLastest()
Get the latest entry in the list
|
E |
getOldest()
Get the oldest entry in the list
|
int |
limit()
Limit specifies how many elements can be contained in this list.
|
add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArrayequals, hashCode, listIterator, removeRange, subListcontainsAll, isEmpty, removeAll, retainAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitpublic EvictingList(int limit)
limit - Max size for the listpublic boolean add(E o)
public int limit()
public E getOldest()
public E getLastest()