|
sdr 0.5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.cscott.sdr.calls.PredicateList
public abstract class PredicateList
This class contains all the predicates known to the system.
Field Summary | |
---|---|
static Predicate |
AND
Short-circuit boolean conjunction. |
static Predicate |
EQUAL
Numerical equality. |
static Predicate |
FALSE
Always false. |
static Predicate |
GREATER
Numerical comparison. |
static Predicate |
NOT
Boolean negation. |
static Predicate |
OR
Short-circuit boolean disjunction. |
static Predicate |
PROGRAM_AT_LEAST
Check the current dance program level. |
static Predicate |
SELECTED_ARE
|
static Predicate |
TRUE
Always true. |
Constructor Summary | |
---|---|
PredicateList()
|
Method Summary |
---|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Predicate TRUE
js> ds = new DanceState(new DanceProgram(Program.C4), Formation.SQUARED_SET); undefined; js> c = net.cscott.sdr.calls.ast.AstNode.valueOf('(Condition true)'); (Condition true) js> c.getPredicate().evaluate(ds.dance, ds.currentFormation(), c) true
public static final Predicate FALSE
js> ds = new DanceState(new DanceProgram(Program.C4), Formation.SQUARED_SET); undefined; js> c = net.cscott.sdr.calls.ast.AstNode.valueOf('(Condition false)'); (Condition false) js> c.getPredicate().evaluate(ds.dance, ds.currentFormation(), c) false
public static final Predicate NOT
js> ds = new DanceState(new DanceProgram(Program.C4), Formation.SQUARED_SET); undefined; js> c = net.cscott.sdr.calls.ast.AstNode.valueOf('(Condition not (Condition false))'); (Condition not (Condition false)) js> c.getPredicate().evaluate(ds.dance, ds.currentFormation(), c) true js> c = net.cscott.sdr.calls.ast.AstNode.valueOf('(Condition not (Condition true))'); (Condition not (Condition true)) js> c.getPredicate().evaluate(ds.dance, ds.currentFormation(), c) false
public static final Predicate EQUAL
js> ds = new DanceState(new DanceProgram(Program.C4), Formation.SQUARED_SET); undefined; js> c = net.cscott.sdr.calls.ast.AstNode.valueOf('(Condition equal (Condition "1 1/2") (Condition "1 1/2"))'); (Condition equal (Condition 1 1/2) (Condition 1 1/2)) js> c.getPredicate().evaluate(ds.dance, ds.currentFormation(), c) true js> c = net.cscott.sdr.calls.ast.AstNode.valueOf('(Condition equal (Condition "1 1/2") (Condition 2))'); (Condition equal (Condition 1 1/2) (Condition 2)) js> c.getPredicate().evaluate(ds.dance, ds.currentFormation(), c) false
public static final Predicate GREATER
js> ds = new DanceState(new DanceProgram(Program.C4), Formation.SQUARED_SET); undefined; js> c = net.cscott.sdr.calls.ast.AstNode.valueOf('(Condition greater (Condition "1 1/2") (Condition "1 1/2"))'); (Condition greater (Condition 1 1/2) (Condition 1 1/2)) js> c.getPredicate().evaluate(ds.dance, ds.currentFormation(), c) false js> c = net.cscott.sdr.calls.ast.AstNode.valueOf('(Condition greater (Condition 2) (Condition "1 1/2"))'); (Condition greater (Condition 2) (Condition 1 1/2)) js> c.getPredicate().evaluate(ds.dance, ds.currentFormation(), c) true
public static final Predicate AND
js> ds = new DanceState(new DanceProgram(Program.C4), Formation.SQUARED_SET); undefined; js> c = net.cscott.sdr.calls.ast.AstNode.valueOf('(Condition and (Condition true) (Condition true) (Condition false))'); (Condition and (Condition true) (Condition true) (Condition false)) js> c.getPredicate().evaluate(ds.dance, ds.currentFormation(), c) false js> c = net.cscott.sdr.calls.ast.AstNode.valueOf('(Condition and (Condition true) (Condition true) (Condition true))'); (Condition and (Condition true) (Condition true) (Condition true)) js> c.getPredicate().evaluate(ds.dance, ds.currentFormation(), c) true
public static final Predicate OR
js> ds = new DanceState(new DanceProgram(Program.C4), Formation.SQUARED_SET); undefined; js> c = net.cscott.sdr.calls.ast.AstNode.valueOf('(Condition or (Condition false) (Condition false) (Condition false))'); (Condition or (Condition false) (Condition false) (Condition false)) js> c.getPredicate().evaluate(ds.dance, ds.currentFormation(), c) false js> c = net.cscott.sdr.calls.ast.AstNode.valueOf('(Condition or (Condition false) (Condition false) (Condition true))'); (Condition or (Condition false) (Condition false) (Condition true)) js> c.getPredicate().evaluate(ds.dance, ds.currentFormation(), c) true
public static final Predicate PROGRAM_AT_LEAST
js> ds = new DanceState(new DanceProgram(Program.PLUS), Formation.SQUARED_SET); undefined; js> c = net.cscott.sdr.calls.ast.AstNode.valueOf('(Condition program at least (Condition BASIC))'); (Condition program at least (Condition BASIC)) js> c.getPredicate().evaluate(ds.dance, ds.currentFormation(), c) true js> c = net.cscott.sdr.calls.ast.AstNode.valueOf('(Condition program at least (Condition A2))'); (Condition program at least (Condition A2)) js> c.getPredicate().evaluate(ds.dance, ds.currentFormation(), c) false
public static final Predicate SELECTED_ARE
Constructor Detail |
---|
public PredicateList()
|
sdr 0.5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |