|
LimeWire Collection Component API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.limewire.collection.RoundRobinQueue<T>
public class RoundRobinQueue<T>
A round-robin queue. next() returns an item on the queue and then puts
that item to the end of the queue.
RoundRobinQueue<Integer> rrq = new RoundRobinQueue<Integer>();
rrq.enqueue(1);
rrq.enqueue(2);
for(Integer i = rrq.size() + 1; i > 0; i--)
System.out.println(rrq.next());
Output:
1
2
1
| Constructor Summary | |
|---|---|
RoundRobinQueue()
do not create the terminating elements |
|
| Method Summary | |
|---|---|
void |
clear()
|
void |
enqueue(T value)
enqueues the specified object in the round-robin queue. |
T |
next()
|
void |
remove(T o)
Removes the next occurrence of the specified object |
void |
removeAllOccurences(T o)
Removes all occurrences of the given object in the list. |
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RoundRobinQueue()
| Method Detail |
|---|
public void enqueue(T value)
value - the object to add to the queuepublic T next()
public void remove(T o)
o - the object to remove from the queue.public void removeAllOccurences(T o)
o - the object to remove.public int size()
public void clear()
|
LimeWire Collection Component API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||