Package eu.simuline.util
Class FIFOList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.Vector<E>
-
- eu.simuline.util.FIFOList<E>
-
- Type Parameters:
E- the class of the elements of this list.
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<E>,Collection<E>,List<E>,Queue<E>,RandomAccess
public final class FIFOList<E> extends Vector<E> implements Queue<E>
The FIFOList class represents a first-in-first-out (FIFO) stack of objects. The usual push and pop operations are provided, as well as a method to peek at the top item on the stack, a method to test for whether the stack is empty, and a method to search the stack for an item and discover how far it is from the top.When a stack is first created, it contains no items.
- Version:
- 1.0
- Author:
- Ernst Reissner
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID-
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Modifier Constructor Description FIFOList()Creates an empty FIFOList.protectedFIFOList(Collection<? extends E> coll)Constructs a vector containing the elements of the specified collection, in the order they are returned by the collection's iterator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <E> FIFOList<E>create()static <E> FIFOList<E>create(Collection<? extends E> coll)Eelement()booleanoffer(E item)Constructs a vector.Epeek()Epoll()Eremove()-
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FIFOList
public FIFOList()
Creates an empty FIFOList.
-
FIFOList
protected FIFOList(Collection<? extends E> coll)
Constructs a vector containing the elements of the specified collection, in the order they are returned by the collection's iterator.- Parameters:
coll- the collection whose elements are to be placed into this FIFOList.- Throws:
NullPointerException- if the specified collection is null.
-
-
Method Detail
-
create
public static <E> FIFOList<E> create()
-
create
public static <E> FIFOList<E> create(Collection<? extends E> coll)
-
offer
public boolean offer(E item)
Constructs a vector.
-
-