tom.library.sl
Interface Strategy

All Superinterfaces:
Visitable
All Known Implementing Classes:
AbstractStrategy, All, AllSeq, Choice, ChoiceId, DeRef, Fail, Identity, IfThenElse, Mu, MuVar, Not, Omega, OmegaU, One, OneId, Pselect, Sequence, SequenceId, StrategyFwd

public interface Strategy
extends Visitable


Method Summary
 Strategy accept(StrategyFwd v)
           
 Environment getEnvironment()
          Get a reference to the current environment.
 void setEnvironment(Environment p)
          Set up a new environment
 int visit()
          Visits the current subject (found in the environment) and place its result in the environment.
 Visitable visit(Environment envt)
          execute the strategy in the given environment (on its current subject).
 Visitable visit(Visitable any)
          Visits the subject any by providing the environment
 Visitable visitLight(Visitable any)
          Visits the subject any in a light way (without environment)
 
Methods inherited from interface tom.library.sl.Visitable
getChildAt, getChildCount, getChildren, setChildAt, setChildren
 

Method Detail

setEnvironment

void setEnvironment(Environment p)
Set up a new environment


getEnvironment

Environment getEnvironment()
Get a reference to the current environment.

Returns:
the current environment

visit

Visitable visit(Visitable any)
                throws VisitFailure
Visits the subject any by providing the environment

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

visitLight

Visitable visitLight(Visitable any)
                     throws VisitFailure
Visits the subject any in a light way (without environment)

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

visit

Visitable visit(Environment envt)
                throws VisitFailure
execute the strategy in the given environment (on its current subject). This method can only be used inside user strategies to execute another strategy but with the current environment of the user strategy.

Parameters:
envt - the environment where execute the strategy.
Throws:
VisitFailure

visit

int visit()
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


accept

Strategy accept(StrategyFwd v)
                throws VisitFailure
Throws:
VisitFailure