|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmln.Expression
public class Expression
An expression to a function is like a literal to a predicate. The interesting part is that expressions can be nested. The value of an expression can be numeric/string/boolean.
Constructor Summary | |
---|---|
Expression(Function func)
Construct a new expression based on the function func_ |
Method Summary | |
---|---|
void |
addArgument(Expression expr)
Append an argument to the underlying function |
static Expression |
and(Expression e1,
Expression e2)
Boolean AND |
void |
bindVariables(java.util.Map<java.lang.String,java.lang.String> mapVarVal)
Bind variable references to their values in the symbol table. |
static Expression |
exprConstInteger(int n)
Atomic expression representing a constant integer |
static Expression |
exprConstNum(double num)
Atomic expression representing a constant number |
static Expression |
exprConstString(java.lang.String str)
Atomic expression representing a constant string |
static Expression |
exprVariableBinding(java.lang.String var)
Atomic expression representing a variable binding |
java.util.HashSet<java.lang.String> |
getVars()
Get the variables referenced by this expression. |
boolean |
isBoolean()
Test if this expression returns a boolean value |
boolean |
isNumeric()
Test if this expression returns a numeric value |
boolean |
isString()
Test if this expression returns a string value |
static Expression |
not(Expression e)
Boolean negation |
static Expression |
or(Expression e1,
Expression e2)
Boolean OR |
void |
renameVariables(java.util.Map<java.lang.String,java.lang.String> mapVarVar)
Bind variable references to their values in the symbol table. |
java.lang.String |
toSQL()
Get the SQL snippet for this expression |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Expression(Function func)
func_
func
- the underlying functionMethod Detail |
---|
public void addArgument(Expression expr)
expr
- the new argumentpublic static Expression and(Expression e1, Expression e2)
e1
- e2
- public void bindVariables(java.util.Map<java.lang.String,java.lang.String> mapVarVal)
mapVarVal
- public static Expression exprConstInteger(int n)
n
- public static Expression exprConstNum(double num)
public static Expression exprConstString(java.lang.String str)
public static Expression exprVariableBinding(java.lang.String var)
public java.util.HashSet<java.lang.String> getVars()
public boolean isBoolean()
public boolean isNumeric()
public boolean isString()
public static Expression not(Expression e)
e
- public static Expression or(Expression e1, Expression e2)
e1
- e2
- public void renameVariables(java.util.Map<java.lang.String,java.lang.String> mapVarVar)
mapVarVar
- public java.lang.String toSQL()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |