tom.library.sl
Class IfThenElse

java.lang.Object
  extended by tom.library.sl.AbstractStrategy
      extended by tom.library.sl.IfThenElse
All Implemented Interfaces:
Strategy, Visitable

public class IfThenElse
extends AbstractStrategy


Field Summary
static int CONDITION
           
static int FALSE_CASE
           
static int TRUE_CASE
           
 
Fields inherited from class tom.library.sl.AbstractStrategy
environment, visitors
 
Constructor Summary
IfThenElse(Strategy c, Strategy t)
           
IfThenElse(Strategy c, Strategy t, Strategy f)
           
 
Method Summary
 int visit()
          Visits the current subject (found in the environment) and place its result in the environment.
 Visitable visitLight(Visitable x)
          Visits the subject any in a light way (without environment)
 
Methods inherited from class tom.library.sl.AbstractStrategy
accept, getChildAt, getChildCount, getChildren, getEnvironment, getRoot, getSubject, init, init, initSubterm, initSubterm, initSubterm, initSubterm, initSubterm, setChildAt, setChildren, setEnvironment, setRoot, setSubject, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONDITION

public static final int CONDITION
See Also:
Constant Field Values

TRUE_CASE

public static final int TRUE_CASE
See Also:
Constant Field Values

FALSE_CASE

public static final int FALSE_CASE
See Also:
Constant Field Values
Constructor Detail

IfThenElse

public IfThenElse(Strategy c,
                  Strategy t,
                  Strategy f)

IfThenElse

public IfThenElse(Strategy c,
                  Strategy t)
Method Detail

visitLight

public Visitable visitLight(Visitable x)
                     throws VisitFailure
Description copied from interface: Strategy
Visits the subject any in a light way (without environment)

Parameters:
x - the subject to visit.
Throws:
VisitFailure - in case of failure.

visit

public int visit()
Description copied from interface: Strategy
Visits the current subject (found in the environment) and place its result in the environment. Sets the environment flag to Environment.FAILURE in case of failure