|
|||||||||
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.One
public class One
Basic strategy combinator with one strategy argument s
, that
applies this strategy s
to exactly one child. If for all children
the strategy s
fails, One(s)
fails. Applying One
combinator to a constant always
fails.
One(s)[f(t1,...,ti,...,tn)]=f(t1,...,ti',...,,tn)
if s[t1], ..., s[ti-1]
fail and s[ti]=ti'
fails if s[t1],...,s[tn]
fail.
One(s)[c]
fails if c
is a constant
Field Summary | |
---|---|
static int |
ARG
|
Fields inherited from class tom.library.sl.AbstractStrategy |
---|
environment, visitors |
Constructor Summary | |
---|---|
One(Strategy v)
|
Method Summary | |
---|---|
int |
visit()
Visits the current subject (found in the environment) and place its result in the environment. |
Visitable |
visitLight(Visitable any)
Deprecated. use fire() instead |
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 |
---|
public static final int ARG
Constructor Detail |
---|
public One(Strategy v)
Method Detail |
---|
public Visitable visitLight(Visitable any) throws VisitFailure
any
- the subject to visit.
VisitFailure
- in case of failure.public int visit()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |