More information: http://www.cs.berkeley.edu/~mdw/proj/seda/

seda.sandStorm.core
Class QueueThresholdPredicate

java.lang.Object
  |
  +--seda.sandStorm.core.QueueThresholdPredicate
All Implemented Interfaces:
EnqueuePredicateIF

public class QueueThresholdPredicate
extends java.lang.Object
implements EnqueuePredicateIF

This enqueue predicate implements a simple threshold for the size of the queue.


Constructor Summary
QueueThresholdPredicate(SinkIF sink, int threshold)
          Create a new QueueThresholdPredicate for the given sink and threshold.
 
Method Summary
 boolean accept(QueueElementIF qel)
          Returns true if the given element can be accepted into the queue.
 int getThreshold()
          Return the current queue threshold.
 void setThreshold(int threshold)
          Set the current queue threshold.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueThresholdPredicate

public QueueThresholdPredicate(SinkIF sink,
                               int threshold)
Create a new QueueThresholdPredicate for the given sink and threshold. A threshold of -1 indicates no threshold.
Method Detail

accept

public boolean accept(QueueElementIF qel)
Returns true if the given element can be accepted into the queue.
Specified by:
accept in interface EnqueuePredicateIF
Following copied from interface: seda.sandStorm.api.EnqueuePredicateIF
Parameters:
element - The QueueElementIF to enqueue
Returns:
True if the sink accepts the element; false otherwise.

getThreshold

public int getThreshold()
Return the current queue threshold.

setThreshold

public void setThreshold(int threshold)
Set the current queue threshold. A queue threshold of -1 indicates an infinite threshold.

More information: http://www.cs.berkeley.edu/~mdw/proj/seda/