org.shapelogic.logic
Class SimpleTask

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by org.shapelogic.logic.BaseTask
          extended by org.shapelogic.logic.SimpleTask
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode, org.apache.commons.jexl.JexlContext, Calc0, CalcInvoke, CalcValue, LazyCalc, Task
Direct Known Subclasses:
CountCollectionGreaterTask, CountCollectionTask, NumericGreaterTask, ParametricRuleTask, SimpleNumericTask

public class SimpleTask
extends BaseTask

Base class for tasks where you have an expression to be evaluated in local context and an expected value.

Author:
Sami Badawi
See Also:
Serialized Form

Field Summary
protected  java.lang.Object _expected
           
protected  java.lang.String _expression
           
 
Fields inherited from class org.shapelogic.logic.BaseTask
_endTime, _failedSubTasksCount, _injector, _interest, _lastSubTaskState, _localContext, _localModule, _pathWork, _score, _selfWork, _selfWorkEstimate, _startTime, _state, _succededSubTasksCount, _value, CONTEXT_CALCULATION_MAP, DEFAULT_INTEREST, DEFAULT_SCORE, NAMED_TASKS, WORK_NOT_KNOWN
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
SimpleTask(BaseTask parent, boolean createLocalContext, java.lang.String expression, java.lang.Object expectedValue)
           
 
Method Summary
 java.lang.String getExpression()
          Get the expression that is evaluated in the JEXL context.
 boolean match()
          Can be overridden
 void setup()
          Currently not super well define used for 2 purposes: Reset: called from the outside if you want to reuse it init: Called from the inside when calculation start to have everything setup maybe the semantic could work for both? TODO: This should be separated better.
 
Methods inherited from class org.shapelogic.logic.BaseTask
calcNextSubTask, doPrintOnFail, errorOnFail, findEnumValue, findNamedValue, findNamedValueUsingSubTasks, getContext, getContextCalculation, getContextCalculationMap, getInjector, getInterest, getLastSubTaskState, getLocalContext, getLocalModule, getLowestContext, getName, getNamedTask, getNamedValue, getParentTask, getPathWork, getScore, getSelfTreeNode, getSelfWork, getSelfWorkEstimate, getState, getValue, getVars, invoke, isDirty, isPrintOnFail, iterator, mainCalc, postCalc, preCalc, setClassInContext, setClassInContext, setClassInContext, setContextCalculation, setInterest, setName, setNamedTask, setNamedValue, setPrintOnFail, setState, setVars
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.tree.TreeNode
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
 

Field Detail

_expression

protected java.lang.String _expression

_expected

protected java.lang.Object _expected
Constructor Detail

SimpleTask

public SimpleTask(BaseTask parent,
                  boolean createLocalContext,
                  java.lang.String expression,
                  java.lang.Object expectedValue)
Method Detail

match

public boolean match()
Can be overridden

Specified by:
match in interface Task
Overrides:
match in class BaseTask

setup

public void setup()
Description copied from interface: LazyCalc
Currently not super well define used for 2 purposes: Reset: called from the outside if you want to reuse it init: Called from the inside when calculation start to have everything setup maybe the semantic could work for both? TODO: This should be separated better.

Specified by:
setup in interface LazyCalc
Overrides:
setup in class BaseTask

getExpression

public java.lang.String getExpression()
Get the expression that is evaluated in the JEXL context. For testing.



Copyright © 2009. All Rights Reserved.