01: package org.osbl.agent.model;
02:
03: /**
04: * Actions are the second of the key components of a Rule (the other being its Conditions).
05: * When a Rule is run, and all the Conditions are met, then the List of Actions is gone through
06: * and its Actions executed one by one.
07: *
08: * Classes that wish to pose as Actions need to implement method {@link #execute execute}.
09: *
10: * @see Rule
11: * @see Condition
12: * @author Sebastian Nozzi.
13: */
14: public interface Action {
15:
16: /**
17: * This method is called in an Action when it is to be executed.
18: * Normally invoked by a Rule object.
19: *
20: * @param context the RuleContext in which the action is executed.
21: *
22: * @see Rule#executeActions(RuleContext)
23: */
24: public void execute(RuleContext context);
25:
26: /**
27: * Implements a better version of "equals", comparing Actions of what they
28: * do semantically.
29: *
30: * @param anotherAction the other Action to compare
31: *
32: * @return true, if both Actions do the same
33: *
34: * @see Rule#equals(Object)
35: */
36: public boolean equals(Object anotherAction);
37: }
|