public final class ThresholdEnqueuePredicate
extends java.lang.Object
implements org.apache.excalibur.event.EnqueuePredicate
| Modifier and Type | Field and Description |
|---|---|
private int |
m_threshold |
| Constructor and Description |
|---|
ThresholdEnqueuePredicate(int limit)
Create a new ThresholdEnqueuePredicate with the supplied limit.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(java.lang.Object[] elements,
org.apache.excalibur.event.Sink modifyingSink)
Returns true if the Sink size + the number of elements is less than
the threshold.
|
boolean |
accept(java.lang.Object element,
org.apache.excalibur.event.Sink modifyingSink)
Returns true if the Sink size + 1 (the element) is less than the
threshold.
|
public ThresholdEnqueuePredicate(int limit)
limit - A number greater than zeropublic boolean accept(java.lang.Object element,
org.apache.excalibur.event.Sink modifyingSink)
accept in interface org.apache.excalibur.event.EnqueuePredicatepublic boolean accept(java.lang.Object[] elements,
org.apache.excalibur.event.Sink modifyingSink)
accept in interface org.apache.excalibur.event.EnqueuePredicate