public final class BoundedLinkedList<E> extends 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.modCount
Constructor and Description |
---|
BoundedLinkedList(int maxSize) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E object) |
void |
add(int location,
E object) |
boolean |
addAll(Collection<? extends E> collection) |
boolean |
addAll(int location,
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) |
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
iterator
equals, hashCode, listIterator, removeRange, subList
containsAll, isEmpty, removeAll, retainAll
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
parallelStream, removeIf, stream
public boolean add(E object)
public void add(int location, E object)
public boolean addAll(@NonNull Collection<? extends E> collection)
addAll
in interface Collection<E>
addAll
in interface List<E>
addAll
in class LinkedList<E>
public boolean addAll(int location, Collection<? extends E> collection)
public void addFirst(E object)
public void addLast(E object)
@NonNull public String toString()
toString
in class AbstractCollection<E>
public boolean offer(E o)
public boolean offerFirst(E e)
offerFirst
in interface Deque<E>
offerFirst
in class LinkedList<E>
public boolean offerLast(E e)