Package com.google.code.yanf4j.util
Class SimpleQueue<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractQueue<T>
-
- com.google.code.yanf4j.util.SimpleQueue<T>
-
- All Implemented Interfaces:
Iterable<T>,Collection<T>,Queue<T>
public class SimpleQueue<T> extends AbstractQueue<T>
Simple queue. All methods are thread-safe.- Author:
- dennis zhuang
-
-
Field Summary
Fields Modifier and Type Field Description protected LinkedList<T>list
-
Constructor Summary
Constructors Constructor Description SimpleQueue()SimpleQueue(int initializeCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<T>iterator()booleanoffer(T e)Tpeek()Tpoll()intsize()-
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
-
-
-
Field Detail
-
list
protected final LinkedList<T> list
-
-
Method Detail
-
offer
public boolean offer(T e)
-
peek
public T peek()
-
poll
public T poll()
-
iterator
public Iterator<T> iterator()
- Specified by:
iteratorin interfaceCollection<T>- Specified by:
iteratorin interfaceIterable<T>- Specified by:
iteratorin classAbstractCollection<T>
-
size
public int size()
- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein classAbstractCollection<T>
-
-