inpro.dm.isu.rule
Class AbstractRule

java.lang.Object
  extended by inpro.dm.isu.rule.AbstractRule
Direct Known Subclasses:
AbstractIUNetworkRule

public abstract class AbstractRule
extends java.lang.Object

An abstract rule with previsions for trigger and effect interfaces

Author:
okko

Nested Class Summary
static interface AbstractRule.Effects
          A list of update methods that an implementing information state must provide to allow update rules to apply changes to it.
static interface AbstractRule.Triggers
          A list of query methods that an implementing information state must provide to allow update rules to query it.
 
Constructor Summary
AbstractRule()
           
 
Method Summary
abstract  boolean apply(AbstractInformationState is)
          A method that a rule engine calls to apply this rule's effect to.
 java.lang.String toString()
           
abstract  boolean triggers(AbstractInformationState is)
          A method that a rule engine calls to verify if this rule triggers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractRule

public AbstractRule()
Method Detail

triggers

public abstract boolean triggers(AbstractInformationState is)
A method that a rule engine calls to verify if this rule triggers.

Parameters:
is - the InformationState to check this rule's trigger conditions against.
Returns:
true if triggers

apply

public abstract boolean apply(AbstractInformationState is)
A method that a rule engine calls to apply this rule's effect to.

Parameters:
is - the InformationState to apply this rule's effects on.
Returns:
true if applying changes the information state.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object