public final class BoundedLinkedList<E>
extends java.util.LinkedList<E>
LinkedList
version with a maximum number of elements. When adding
elements to the end of the list, first elements in the list are discarded if
the maximum size is reached.Constructor and Description |
---|
BoundedLinkedList(int maxSize) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E object) |
void |
add(int location,
E object) |
boolean |
addAll(java.util.Collection<? extends E> collection) |
boolean |
addAll(int location,
java.util.Collection<? extends E> collection) |
void |
addFirst(E object) |
void |
addLast(E object) |
boolean |
offer(E o) |
boolean |
offerFirst(E e) |
boolean |
offerLast(E e) |
void |
push(E e) |
java.lang.String |
toString() |
clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
equals, hashCode, listIterator, removeRange, subList
containsAll, isEmpty, removeAll, retainAll
finalize, getClass, notify, notifyAll, wait, wait, wait
public boolean add(E object)
public void add(int location, E object)
public boolean addAll(@NonNull java.util.Collection<? extends E> collection)
public boolean addAll(int location, java.util.Collection<? extends E> collection)
public void addFirst(E object)
public void addLast(E object)
@NonNull public java.lang.String toString()
toString
in class java.util.AbstractCollection<E>
public boolean offer(E o)
public boolean offerFirst(E e)
public boolean offerLast(E e)