|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.d_haven.event.impl.ThresholdEnqueuePredicate
The ThresholdEnqueuePredicate limits the elements that can be enqueued based on the size of the Pipe.
| Constructor Summary | |
ThresholdEnqueuePredicate(int limit)
Create a new ThresholdEnqueuePredicate with the supplied limit. |
|
| Method Summary | |
boolean |
accept(java.lang.Object[] elements,
Sink modifyingSink)
Returns true if the Sink size + the number of elements is less than the threshold. |
boolean |
accept(java.lang.Object element,
Sink modifyingSink)
Returns true if the Sink size + 1 (the element) is less than the threshold. |
int |
getThreshold()
Get the threshold size. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ThresholdEnqueuePredicate(int limit)
limit - A number greater than zero| Method Detail |
public boolean accept(java.lang.Object element,
Sink modifyingSink)
accept in interface EnqueuePredicateelement - the element being testedmodifyingSink - the sink to enqueue to
true if we are under the threshold
public boolean accept(java.lang.Object[] elements,
Sink modifyingSink)
accept in interface EnqueuePredicateelements - the elements being testedmodifyingSink - the sink to enqueue to
true if we are under the thresholdpublic int getThreshold()
public java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||