|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.d_haven.event.command.SwitchedEnqueuePredicate
public class SwitchedEnqueuePredicate
The SwitchedEnqueuePredicate provides a mechanism where we can
explicitly tell the queue whether we are accepting new events or not.
This EnqueuePredicate is useful in situations where you have to set
the accept status based on certain events. One example of where this
is used is in the CommandManager
code.
Field Summary | |
---|---|
private boolean |
m_isAccepting
|
Constructor Summary | |
---|---|
SwitchedEnqueuePredicate()
Create a SwitchedEnqueuePredicate. |
Method Summary | |
---|---|
void |
accept()
Tell this EnqueuePredicate to start allowing new events to be enqueued. |
boolean |
accept(java.lang.Object[] elements,
Sink modifyingSink)
Tests the given element for acceptance onto the m_sink. |
boolean |
accept(java.lang.Object element,
Sink modifyingSink)
Tests the given element for acceptance onto the m_sink. |
void |
block()
Tell this EnqueuePredicate to start blocking new events to be enqueued. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private volatile boolean m_isAccepting
Constructor Detail |
---|
public SwitchedEnqueuePredicate()
accept(java.lang.Object, org.d_haven.event.Sink)
method.
Method Detail |
---|
public boolean accept(java.lang.Object element, Sink modifyingSink)
accept
in interface EnqueuePredicate
element
- The element to enqueuemodifyingSink
- The sink that is used for this predicate
true
if the sink accepts the element;
false
otherwise.public boolean accept(java.lang.Object[] elements, Sink modifyingSink)
accept
in interface EnqueuePredicate
elements
- The array of elements to enqueuemodifyingSink
- The sink that is used for this predicate
true
if the sink accepts all the elements;
false
otherwise.public void block()
public void accept()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |