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:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<E>,java.util.Collection<E>,java.util.List<E>,java.util.Queue<E>,java.util.RandomAccess
public final class FIFOList<E> extends java.util.Vector<E> implements java.util.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
-
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(java.util.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
-
-
-
-
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(java.util.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:
java.lang.NullPointerException- if the specified collection is null.
-
-
Method Detail
-
create
public static <E> FIFOList<E> create()
-
create
public static <E> FIFOList<E> create(java.util.Collection<? extends E> coll)
-
offer
public boolean offer(E item)
Constructs a vector.- Specified by:
offerin interfacejava.util.Queue<E>- Parameters:
item- the element to insert.- Returns:
- true since nothing can prevent the item from being inserted.
-
-