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:
java.io.Serializable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.List<E>
,java.util.Queue<E>
public class CircularQueue<E> extends java.util.AbstractList<E> implements java.util.Queue<E>, java.io.Serializable
A unbounded circular queue based on array.- Author:
- Apache MINA Project
- See Also:
- Serialized Form
-
-
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 void
add(int idx, E o)
boolean
add(E o)
int
capacity()
void
clear()
E
element()
E
get(int idx)
boolean
isEmpty()
boolean
offer(E item)
E
peek()
E
poll()
E
remove()
E
remove(int idx)
E
set(int idx, E o)
int
size()
java.lang.String
toString()
-
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
-
-
-
-
Method Detail
-
capacity
public int capacity()
- Returns:
- the capacity of this queue.
-
clear
public void clear()
-
get
public E get(int idx)
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.util.AbstractCollection<E>
-
add
public boolean add(E o)
-
add
public void add(int idx, E o)
-
remove
public E remove(int idx)
-
-