org.drools.semantics.base
Class BaseDuration

java.lang.Object
  extended by org.drools.semantics.base.BaseDuration
All Implemented Interfaces:
java.io.Serializable, Duration

public class BaseDuration
extends java.lang.Object
implements Duration

Implementation of the Duration interface for specifying truthness duration.

See Also:
Serialized Form

Constructor Summary
BaseDuration(Rule rule, long seconds)
          Constructor.
 
Method Summary
 long getDuration(Tuple tuple)
          Retrieves the duration for which the conditions of this Tuple must remain true before the rule will fire.
 Rule getRule()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseDuration

public BaseDuration(Rule rule,
                    long seconds)
Constructor.

Parameters:
seconds - the number of seconds of the duration
Method Detail

getDuration

public long getDuration(Tuple tuple)
Retrieves the duration for which the conditions of this Tuple must remain true before the rule will fire.

Specified by:
getDuration in interface Duration
Parameters:
tuple - the Tuple
Returns:
the duration in seconds

getRule

public Rule getRule()