Package org.apache.mina.util
Class CircularQueue<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- org.apache.mina.util.CircularQueue<E>
-
- Type Parameters:
E- The type of elements stored inthe queue
- All Implemented Interfaces:
Serializable,Iterable<E>,Collection<E>,List<E>,Queue<E>
public class CircularQueue<E> extends AbstractList<E> implements Queue<E>, Serializable
A unbounded circular queue based on array.- Author:
- Apache MINA Project
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description CircularQueue()Construct a new, empty, circular queue.CircularQueue(int initialCapacity)Construct a new circular queue with an initial capacity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int idx, E o)booleanadd(E o)intcapacity()voidclear()Eelement()Eget(int idx)booleanisEmpty()booleanoffer(E item)Epeek()Epoll()Eremove()Eremove(int idx)Eset(int idx, E o)intsize()StringtoString()-
Methods inherited from class java.util.AbstractList
addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Method Detail
-
capacity
public int capacity()
- Returns:
- the capacity of this queue.
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceList<E>- Overrides:
clearin classAbstractList<E>
-
get
public E get(int idx)
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<E>- Specified by:
isEmptyin interfaceList<E>- Overrides:
isEmptyin classAbstractCollection<E>
-
size
public int size()
- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceList<E>- Specified by:
sizein classAbstractCollection<E>
-
toString
public String toString()
- Overrides:
toStringin classAbstractCollection<E>
-
add
public boolean add(E o)
-
add
public void add(int idx, E o)
-
remove
public E remove(int idx)
-
-