org.d_haven.event.impl
public final class ThresholdEnqueuePredicate extends Object implements EnqueuePredicate
Field Summary | |
---|---|
int | m_threshold |
Constructor Summary | |
---|---|
ThresholdEnqueuePredicate(int limit)
Create a new ThresholdEnqueuePredicate with the supplied limit.
|
Method Summary | |
---|---|
boolean | accept(Object element, Sink modifyingSink)
Returns true if the Sink size + 1 (the element) is less than the
threshold.
|
boolean | accept(Object[] elements, Sink modifyingSink)
Returns true if the Sink size + the number of elements is less
than the threshold.
|
int | getThreshold()
Get the threshold size.
|
boolean | testThreshold(Sink modifyingSink, int numElements) |
String | toString() |
Parameters: limit A number greater than zero
Parameters: element the element being tested modifyingSink the sink to enqueue to
Returns: true
if we are under the threshold
Parameters: elements the elements being tested modifyingSink the sink to enqueue to
Returns: true
if we are under the threshold
Returns: the threshold