KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jicengine > operation > Operation


1 package org.jicengine.operation;
2
3 /**
4  * An executable operation.
5  *
6  * <p>
7  * Copyright (C) 2004 Timo Laitinen
8  * </p>
9  * @author Timo Laitinen
10  * @created 2004-09-20
11  * @since JICE-0.10
12  */

13
14 public interface Operation {
15
16     /**
17      * So clients may query whether this operation needs
18      * any parameters at all.
19      */

20     public boolean needsParameters();
21
22     /**
23      * <p>
24      * So clients may query if this operation needs a particular
25      * parameter. a return value 'true' means that in order to execute this
26      * parameter, a parameter with the given name must exist in the context.
27      * </p>
28      * <p>
29      * if the parmeter in question is an optional parameter, a true must be
30      * returned.
31      * </p>
32      */

33     public boolean needsParameter(String JavaDoc name);
34
35     /**
36      * <p>
37      * executes the operation in a given context. objects in the context
38      * might be used in evaluation, or operation could produce
39      * more objects into the context.
40      * </p>
41      * <p>
42      * NOTE: operations must be re-executable.
43      * </p>
44      */

45     public Object JavaDoc execute(Context context) throws OperationException;
46
47 }
48
Popular Tags