public abstract class Dyadic extends Expression.Application
Expression.Application, Expression.Base, Expression.BoolConstant, Expression.Constant, Expression.Fixed, Expression.Util, Expression.Valof, Expression.VariableFALSE, 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
ith 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() |
isApplyequals, getName, getValue, isConstant, isVariablepublic Dyadic(Expression L, String F, Expression R)
public int argCount()
ExpressionargCount in interface ExpressionargCount in class Expression.Applicationpublic Expression getArg(int i)
Expressionith argument. Otherwise the behaviour is unspecified.getArg in interface ExpressiongetArg in class Expression.Applicationpublic String getFun()
ExpressiongetFun in interface ExpressiongetFun in class Expression.Applicationpublic 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)
Expressionpublic static Expression and(Expression L, Expression R)
Licenced under the Apache License, Version 2.0