org.apache.mina.util
Class CircularQueue<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
org.apache.mina.util.CircularQueue<E>
- All Implemented Interfaces:
- Serializable, Iterable<E>, Collection<E>, List<E>, Queue<E>
public class CircularQueue<E>
- extends AbstractList<E>
- implements List<E>, Queue<E>, Serializable
A unbounded circular queue based on array.
- Version:
- $Rev: 662890 $, $Date: 2008-06-03 23:14:21 +0200 (mar, 03 jun 2008) $
- Author:
- The Apache MINA Project (dev@mina.apache.org)
- See Also:
- Serialized Form
Methods inherited from interface java.util.List |
addAll, addAll, contains, containsAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, retainAll, subList, toArray, toArray |
CircularQueue
public CircularQueue()
- Construct a new, empty queue.
CircularQueue
public CircularQueue(int initialCapacity)
capacity
public int capacity()
- Returns the capacity of this queue.
clear
public void clear()
- Specified by:
clear
in interface Collection<E>
- Specified by:
clear
in interface List<E>
- Overrides:
clear
in class AbstractList<E>
poll
public E poll()
- Specified by:
poll
in interface Queue<E>
offer
public boolean offer(E item)
- Specified by:
offer
in interface Queue<E>
peek
public E peek()
- Specified by:
peek
in interface Queue<E>
get
public E get(int idx)
- Specified by:
get
in interface List<E>
- Specified by:
get
in class AbstractList<E>
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface Collection<E>
- Specified by:
isEmpty
in interface List<E>
- Overrides:
isEmpty
in class AbstractCollection<E>
size
public int size()
- Specified by:
size
in interface Collection<E>
- Specified by:
size
in interface List<E>
- Specified by:
size
in class AbstractCollection<E>
toString
public String toString()
- Overrides:
toString
in class AbstractCollection<E>
add
public boolean add(E o)
- Specified by:
add
in interface Collection<E>
- Specified by:
add
in interface List<E>
- Specified by:
add
in interface Queue<E>
- Overrides:
add
in class AbstractList<E>
set
public E set(int idx,
E o)
- Specified by:
set
in interface List<E>
- Overrides:
set
in class AbstractList<E>
add
public void add(int idx,
E o)
- Specified by:
add
in interface List<E>
- Overrides:
add
in class AbstractList<E>
remove
public E remove(int idx)
- Specified by:
remove
in interface List<E>
- Overrides:
remove
in class AbstractList<E>
remove
public E remove()
- Specified by:
remove
in interface Queue<E>
element
public E element()
- Specified by:
element
in interface Queue<E>
Copyright © 2004-2008 Apache MINA Project. All Rights Reserved.