public class CircularQueue<T>
extends java.util.AbstractCollection<T>
implements java.util.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() |
java.util.Iterator<T> |
iterator() |
boolean |
offer(T e) |
protected void |
onOverflow() |
T |
peek() |
T |
poll() |
T |
remove() |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
addAll, contains, containsAll, toArray, toArray, toStringpublic CircularQueue(int capacity)
public boolean add(T e)
protected void onOverflow()
public int size()
public boolean isFull()
public boolean isEmpty()
public java.util.Iterator<T> iterator()
public void clear()
public boolean remove(java.lang.Object o)
public boolean removeAll(java.util.Collection<?> c)
Copyright © 2015 Molindo GmbH. All Rights Reserved.