|
||||||||||
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.LinearDispatchQueue
Thread-safe module for dispatching Objects.
Constructor Summary | |
LinearDispatchQueue(LinearOrderedQueue q)
|
|
LinearDispatchQueue(LinearQueue q)
|
Method Summary | |
void |
add(Object o)
Adds a single Object to the Queue. |
void |
addSet(Enumeration e)
Adds an entire Enumeration of elements to the Queue. |
void |
clear()
Empties the Queue. |
boolean |
contains(Object o)
Determines if the Queue contains a copy of the specified Object. |
Enumeration |
elements()
Retrieves an enumerable form of the elements in the Queue. |
boolean |
isEmpty()
Determines if the Queue is empty. |
boolean |
isSealed()
Determines if the Queue is sealed. |
Object |
peekNext()
Retrieves the next Object from the queue without removing it. |
Object |
remove(Object o)
Removes the first found element that is equal to o from the queue. |
Object |
removeNext()
Removes the next element from the Queue. |
void |
seal()
Seals the Queue. |
boolean |
transferTo(Object o,
GenericBlockingQueue q)
Transfers an Object, if it exists, out of this Queue and into another. |
void |
unseal()
Unseals the Queue. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LinearDispatchQueue(LinearOrderedQueue q)
public LinearDispatchQueue(LinearQueue q)
Method Detail |
public void add(Object o)
add
in interface GenericBlockingQueue
o
- the Object to be added
SealedQueueException
- if the Queue is currently sealedpublic void addSet(Enumeration e)
addSet
in interface GenericBlockingQueue
e
- a enumerable set of elements
SealedQueueException
- if the Queue is currently sealedpublic boolean isEmpty()
Queue
isEmpty
in interface Queue
public Object remove(Object o)
Queue
remove
in interface Queue
o
- a copy of the Object to be removed
public Object peekNext()
OrderedBlockingQueue
peekNext
in interface OrderedBlockingQueue
public boolean contains(Object o)
Queue
contains
in interface Queue
o
- an Object to look for copies of
public Enumeration elements()
elements
in interface Queue
public boolean transferTo(Object o, GenericBlockingQueue q)
GenericBlockingQueue
transferTo
in interface GenericBlockingQueue
o
- a copy of the Object to transferq
- the Queue to transfer the copy to
public Object removeNext() throws InterruptedException
removeNext
in interface OrderedBlockingQueue
InterruptedException
- if the current thread is interrupted
while waiting for an element to become availablepublic boolean isSealed()
SealableQueue
isSealed
in interface SealableQueue
public void seal()
SealableQueue
seal
in interface SealableQueue
public void unseal()
SealableQueue
This method is provided as it improves flexibility with a minimum if additional difficulty. That is, reliance on this method may not be a good design. For example, if another thread is currently blocking in a remove operation, no guarantees are made that it will return immediately if the Queue is quickly sealed and then unsealed.
unseal
in interface SealableQueue
public void clear()
Queue
clear
in interface Queue
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |