Package de.gsi.dataset.utils
Class LimitedQueue<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.AbstractSequentialList<E>
-
- java.util.LinkedList<E>
-
- de.gsi.dataset.utils.LimitedQueue<E>
-
- Type Parameters:
E- generic list element type
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<E>,java.util.Collection<E>,java.util.Deque<E>,java.util.List<E>,java.util.Queue<E>
public class LimitedQueue<E> extends java.util.LinkedList<E>- Author:
- rstein
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LimitedQueue(int limit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E o)intgetLimit()intsetLimit(int newLimit)-
Methods inherited from class java.util.LinkedList
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, toArray
-
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
-
-
-
-
Method Detail
-
add
public boolean add(E o)
-
getLimit
public int getLimit()
- Returns:
- length of queue in terms of number of elements
-
setLimit
public int setLimit(int newLimit)
- Parameters:
newLimit- length of queue in terms of number of elements- Returns:
- newly set limit (if valid)
-
-