public abstract class Dyadic extends Expression.Application
Expression.Application, Expression.Base, Expression.BoolConstant, Expression.Constant, Expression.Fixed, Expression.Util, Expression.Valof, Expression.Variable
FALSE, TRUE
Constructor and Description |
---|
Dyadic(Expression L,
String F,
Expression R) |
Modifier and Type | Method and Description |
---|---|
static Expression |
and(Expression L,
Expression R) |
int |
argCount()
If this Expression is an application, answer the number of arguments that
it has.
|
boolean |
evalBool(Object l,
Object r)
Answer the boolean result of evaluating this dyadic expression with
the given arguments
l and r . |
Object |
evalObject(Object l,
Object r)
Answer the Object result of evaluating this dyadic expression with
the given arguments
l and r . |
Expression |
getArg(int i)
If this Expression is an application, and 0 <= i < argCount(), answer the
i th argument. |
String |
getFun()
If this Expression is an application, return the string identifying the function,
which should be a URI.
|
Valuator |
prepare(VariableIndexes vi)
Answer a Valuator which, when run with a set of index-to-value bindings,
evaluates this expression in the light of the given variable-to-index bindings
[ie as though the variables were bound to the corresponding values]
|
String |
toString() |
isApply
equals, getName, getValue, isConstant, isVariable
public Dyadic(Expression L, String F, Expression R)
public int argCount()
Expression
argCount
in interface Expression
argCount
in class Expression.Application
public Expression getArg(int i)
Expression
i
th argument. Otherwise the behaviour is unspecified.getArg
in interface Expression
getArg
in class Expression.Application
public String getFun()
Expression
getFun
in interface Expression
getFun
in class Expression.Application
public Object evalObject(Object l, Object r)
l
and r
.
Either this method or evalBool
must be
over-ridden in concrete sub-classes.public boolean evalBool(Object l, Object r)
l
and r
.
Either this method or evalObject
must be
over-ridden in concrete sub-classes.public Valuator prepare(VariableIndexes vi)
Expression
public static Expression and(Expression L, Expression R)
Copyright ? 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP