Base class for query expression operators. Expressions are organized
into a tree of operators that perform data processing or predicate
testing on input
Object instances.
numChildren:int [read-only]
The number of sub-expressions that are children of this expression.
Implementation
public function get numChildren():int
public function clone():Expression
Creates a cloned copy of the expression. Recursively clones any
sub-expressions.
Returns
public function eval(o:Object = null):*
Evaluates this expression with the given input object.
Parameters
| o:Object (default = null) — the input object to this expression
|
Returns
| * — the result of evaluating the expression
|
public static function expr(o:*):Expression
Utility method that maps an input value into an Expression. If the
input value is already an Expression, it is simply returned. If the
input value is a String, it is interpreted as either a variable or
string literal. If the first and last characters of the string are
single quotes (') or double quotes ("), the characters between the
quotes will be used as a string Literal. If there are no quotes, or
if the string is enclosed by curly braces ({}), the string value
(sans braces) will be used as the property name of a new Variable.
In all other cases (Numbers, Dates, etc), a new Literal expression
for the input value is returned.
Parameters
Returns
| Expression —
an Expression corresponding to the input value
|
public function getChildAt(idx:int):Expression
Returns the sub-expression at the given index.
Parameters
| idx:int — the index of the child sub-expression
|
Returns
public function predicate(o:Object):Boolean
Boolean predicate that tests the output of evaluating this
expression. Returns true if the expression evaluates to true, or
a non-null or non-zero value. Returns false if the expression
evaluates to false, or a null or zero value.
Parameters
| o:Object — the input object to this expression
|
Returns
| Boolean — the Boolean result of evaluating the expression
|
public function setChildAt(idx:int, expr:Expression):Boolean
Set the sub-expression at the given index.
Parameters
| idx:int — the index of the child sub-expression
|
| |
| expr:Expression — the sub-expression to set
|
Returns
| Boolean — true if the the sub-expression was successfully set,
false otherwise
|
public function toString():String
Returns a string representation of the expression.
Returns
| String — this expression as a string value
|
public function visit(f:Function):Boolean
Sequentially invokes the input function on this expression and all
sub-expressions. Complete either when all expressions have been
visited or the input function returns true, thereby signalling an
early exit.
Parameters
| f:Function — the visiting function to invoke on this expression
|
Returns
| Boolean — true if the input function signalled an early exit
|
© 2007-2008 Regents of the University of California. Created Sat Jan 24 2009 11:25 AM.