Package org.jgroups.util
Class BoundedList<T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractQueue<T>
java.util.concurrent.ConcurrentLinkedQueue<T>
org.jgroups.util.BoundedList<T>
- All Implemented Interfaces:
Serializable
,Iterable<T>
,Collection<T>
,Queue<T>
A bounded subclass of LinkedList, oldest elements are removed once max capacity is exceeded. Note that this
class is not synchronized (like LinkedList).
- Version:
- $Id: BoundedList.java,v 1.5 2007/08/08 12:02:05 belaban Exp $
- Author:
- Bela Ban Nov 20, 2003
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds an element at the tail.Methods inherited from class java.util.concurrent.ConcurrentLinkedQueue
addAll, clear, contains, forEach, isEmpty, iterator, offer, peek, poll, remove, removeAll, removeIf, retainAll, size, spliterator, toArray, toArray, toString
Methods inherited from class java.util.AbstractQueue
element, remove
Methods inherited from class java.util.AbstractCollection
containsAll
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
containsAll, equals, hashCode, parallelStream, stream, toArray
-
Constructor Details
-
BoundedList
public BoundedList() -
BoundedList
public BoundedList(int size)
-
-
Method Details
-
add
Adds an element at the tail. Removes an object from the head if capacity is exceeded- Specified by:
add
in interfaceCollection<T>
- Specified by:
add
in interfaceQueue<T>
- Overrides:
add
in classConcurrentLinkedQueue<T>
- Parameters:
obj
- The object to be added
-
removeFromHead
-