|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.zig_project.gpl.common.queue.LinearQueueBase
net.sf.zig_project.gpl.common.queue.LinkedQueue
Queues Objects using a Linked List implementation.
ordering of elements within the Queue are dependant on the implementation,
such as LinkedFifoQueue
. LinkedQueues are ideal for Queues that will
be used temporarily, to store a set of Objects to be processed, then shrink
as each Object is processed.
Nested Class Summary | |
protected static class |
LinkedQueue.LinkedSequencer
Provides an enumerable implementation of the elements within a LinkedQueue. |
protected static class |
LinkedQueue.QueueEntry
A thin wrapper to store Objects into a LinkedList structure. |
Field Summary | |
protected LinkedQueue.QueueEntry |
first
|
Constructor Summary | |
LinkedQueue()
|
Method Summary | |
void |
addFirst(Object o)
Adds an Object to the beginning of the Queue. |
protected void |
addFirstEntry(LinkedQueue.QueueEntry qe)
Adds an entry to the beginning of the Queue. |
void |
addLast(Object o)
Adds an Object to the end of the Queue. |
protected abstract void |
addLastEntry(LinkedQueue.QueueEntry qe)
Adds an entry to the end of the Queue. |
protected boolean |
addUnique(LinkedQueue.QueueEntry qe)
Called by addEntry methods to do any special setup. |
void |
clear()
Empties the Queue. |
boolean |
contains(Object o)
Determines if the Queue contains a copy of the specified Object. |
protected LinkedQueue.QueueEntry |
createEntryFor(Object o)
|
Enumeration |
elements()
Retrieves a list of the elements currently in the queue in a form suitable to enumerate over. |
protected LinkedQueue.QueueEntry |
firstEntry()
Retrieves the first entry from the Queue. |
boolean |
isEmpty()
Determines if the Queue is empty. |
protected abstract LinkedQueue.QueueEntry |
lastEntry()
Retrieves the last entry from the Queue. |
Object |
peekFirst()
Retrieves the first Object in the Queue. |
Object |
peekLast()
Retrieves the last Object in the Queue. |
Object |
remove(Object o)
Removes the first instance of the specified Object found in the Queue. |
protected LinkedQueue.QueueEntry |
removeEntryOf(Object o)
Removes the first entry from the Queue that contains the specified Object. |
Object |
removeFirst()
Removes the first Object in the Queue. |
protected LinkedQueue.QueueEntry |
removeFirstEntry()
Removes the first QueueEntry from the Queue. |
Object |
removeLast()
Removes the last Object in the Queue. |
protected abstract LinkedQueue.QueueEntry |
removeLastEntry()
Removes the last QueueEntry from the Queue. |
protected void |
unlink(LinkedQueue.QueueEntry entry,
LinkedQueue.QueueEntry parent)
Unlinks a QueueEntry out of the current Queue. |
Methods inherited from class net.sf.zig_project.gpl.common.queue.LinearQueueBase |
add, addSet, appendFlat, appendFlat, appendUnrolled, appendUnrolled, bulkMoveTest, prependFlat, prependFlat, prependUnrolled, prependUnrolled, toString, transferTo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected LinkedQueue.QueueEntry first
Constructor Detail |
public LinkedQueue()
Method Detail |
public void clear()
Queue
public Object peekFirst()
LinearQueue
public Object peekLast()
LinearQueue
protected LinkedQueue.QueueEntry firstEntry()
protected abstract LinkedQueue.QueueEntry lastEntry()
protected LinkedQueue.QueueEntry createEntryFor(Object o)
public void addFirst(Object o)
LinearQueue
o
- the Object to addpublic void addLast(Object o)
LinearQueue
o
- the Object to addprotected abstract void addLastEntry(LinkedQueue.QueueEntry qe)
qe
- the entry to addaddUnique(LinkedQueue.QueueEntry)
protected void addFirstEntry(LinkedQueue.QueueEntry qe)
qe
- the entry to addaddUnique(LinkedQueue.QueueEntry)
protected boolean addUnique(LinkedQueue.QueueEntry qe)
qe
- the entry to add to the Queue
protected LinkedQueue.QueueEntry removeFirstEntry()
NullPointerException
- if the Queue is emptyprotected abstract LinkedQueue.QueueEntry removeLastEntry()
NullPointerException
- if the Queue is emptypublic Object removeFirst()
LinearQueue
public Object removeLast()
LinearQueue
public boolean contains(Object o)
Queue
o
- an Object to look for copies of
public boolean isEmpty()
Queue
protected void unlink(LinkedQueue.QueueEntry entry, LinkedQueue.QueueEntry parent)
remove(Object)
, but generally not by
more specialized implementations, such as
removeFirstEntry()
or removeLastEntry()
.
entry
- the entry to unlinkparent
- the parent of entry. if parent==null
it is assumed that first==entry
. Otherwise
it is assumed that parent.next==entry
NullPointerException
- if entry==null
protected LinkedQueue.QueueEntry removeEntryOf(Object o)
o
- the Object to search for copies of.
public Object remove(Object o)
o
- a copy of the Object to remove
public Enumeration elements()
Queue
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |