|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttom.library.sl.AbstractStrategy
tom.library.sl.AbstractStrategyCombinator
public abstract class AbstractStrategyCombinator
Partial implementation of the strategy interface that can be used to
implement new strategy combinators (like the All
strategy).
This class has an attribute of type Strategy array which corresponds to the
combinator arguments. These strategy arguments are also considered as
children when visiting this combinator. Note that this abstract class is
used to define all the sl
strategy combinators.
Field Summary | |
---|---|
protected Strategy[] |
arguments
Strategy arguments of the combinator that can be used to define visit methods |
Fields inherited from class tom.library.sl.AbstractStrategy |
---|
environment |
Constructor Summary | |
---|---|
AbstractStrategyCombinator()
|
Method Summary | |
---|---|
Visitable |
getChildAt(int i)
Returns the Visitable at the specified position in arguments |
int |
getChildCount()
Returns the length of arguments |
Visitable[] |
getChildren()
Returns the list of (non builtin) Visitable children |
Strategy |
getVisitor(int i)
Returns the Strategy at the specified position in arguments |
Strategy[] |
getVisitors()
Returns arguments |
protected void |
initSubterm()
Initializes subterm |
protected void |
initSubterm(Strategy v1)
Initializes subterm by using and adding one Strategy |
protected void |
initSubterm(Strategy[] v)
Initializes subterm by using an array of Strategy |
protected void |
initSubterm(Strategy v1,
Strategy v2)
Initializes subterm by using and adding two Strategy |
protected void |
initSubterm(Strategy v1,
Strategy v2,
Strategy v3)
Initializes subterm by using abd adding three Strategy |
Visitable |
setChildAt(int i,
Visitable child)
Replaces a child at the specified position |
Visitable |
setChildren(Visitable[] children)
Replaces all children of any visitable at once, and returns this visitable. |
Methods inherited from class tom.library.sl.AbstractStrategy |
---|
getAncestor, getEnvironment, getPosition, getRoot, getSubject, init, init, setEnvironment, setRoot, setSubject, visit, visit, visit, visit, visitLight |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface tom.library.sl.Strategy |
---|
visit, visitLight |
Field Detail |
---|
protected Strategy[] arguments
visit
methods
Constructor Detail |
---|
public AbstractStrategyCombinator()
Method Detail |
---|
protected void initSubterm()
protected void initSubterm(Strategy v1)
v1
- first Strategy to add to the arrayprotected void initSubterm(Strategy v1, Strategy v2)
v1
- first Strategy to add to the arrayv2
- second Strategy to add to the arrayprotected void initSubterm(Strategy v1, Strategy v2, Strategy v3)
v1
- first Strategy to add to the arrayv2
- second Strategy to add to the arrayv3
- third Strategy to add to the arrayprotected void initSubterm(Strategy[] v)
v
- array used to initialize the subtermpublic Strategy[] getVisitors()
public Strategy getVisitor(int i)
i
- index of the Strategy to return
public int getChildCount()
public Visitable getChildAt(int i)
i
- index of the Visitable to return
public Visitable[] getChildren()
public Visitable setChildAt(int i, Visitable child)
i
- index of Visitable to setchild
- Visitable so set at the specified position
public Visitable setChildren(Visitable[] children)
children
- array of Visitable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |