public class CircularQueue<T> extends AbstractCollection<T> implements Queue<T>
Queue implementation that uses a single, fixed-size buffer as if it
were connected end-to-end. This structure lends itself easily to buffering
data streams.| Constructor and Description |
|---|
CircularQueue(int capacity)
create a new queue with the given capacity
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T e)
overrides first element in queue if queue is full
|
void |
clear() |
T |
element() |
boolean |
isEmpty() |
boolean |
isFull() |
Iterator<T> |
iterator() |
boolean |
offer(T e) |
protected void |
onOverflow() |
T |
peek() |
T |
poll() |
T |
remove() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
addAll, contains, containsAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAll, contains, containsAll, equals, hashCode, toArray, toArraypublic CircularQueue(int capacity)
public boolean add(T e)
add in interface Collection<T>add in interface Queue<T>add in class AbstractCollection<T>Queue.add(Object)protected void onOverflow()
public int size()
size in interface Collection<T>size in class AbstractCollection<T>public boolean isFull()
public boolean isEmpty()
isEmpty in interface Collection<T>isEmpty in class AbstractCollection<T>public Iterator<T> iterator()
iterator in interface Iterable<T>iterator in interface Collection<T>iterator in class AbstractCollection<T>public void clear()
clear in interface Collection<T>clear in class AbstractCollection<T>public boolean remove(Object o)
remove in interface Collection<T>remove in class AbstractCollection<T>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<T>removeAll in class AbstractCollection<T>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<T>retainAll in class AbstractCollection<T>Copyright © 2014 Molindo GmbH. All Rights Reserved.