Packageflare.query
Classpublic class CompositeExpression
InheritanceCompositeExpression Inheritance Expression
SubclassesAnd, Fn, Or, Xor

Base class for expressions with an arbitrary number of sub-expressions.



Public Properties
 PropertyDefined by
  numChildren : int
[read-only] The number of sub-expressions that are children of this expression.
CompositeExpression
Protected Properties
 PropertyDefined by
  _children : Array
Array of sub-expressions.
CompositeExpression
Public Methods
 MethodDefined by
  
CompositeExpression(items:Object = null)
Creates a new CompositeExpression.
CompositeExpression
  
addChild(expr:Expression):void
Adds an additional sub-expression to this composite.
CompositeExpression
 Inherited
Creates a cloned copy of the expression.
Expression
 Inherited
eval(o:Object = null):*
Evaluates this expression with the given input object.
Expression
 Inherited
[static] Utility method that maps an input value into an Expression.
Expression
  
Returns the sub-expression at the given index.
CompositeExpression
 Inherited
predicate(o:Object):Boolean
Boolean predicate that tests the output of evaluating this expression.
Expression
  
Removes all sub-expressions from this composite.
CompositeExpression
  
removeChild(expr:Expression):Boolean
Removes a sub-expression from this composite.
CompositeExpression
  
setChildAt(idx:int, expr:Expression):Boolean
Set the sub-expression at the given index.
CompositeExpression
  
setChildren(array:Array):void
Sets the sub-expressions of this composite
CompositeExpression
 Inherited
toString():String
Returns a string representation of the expression.
Expression
 Inherited
visit(f:Function):Boolean
Sequentially invokes the input function on this expression and all sub-expressions.
Expression
Protected Methods
 MethodDefined by
  
Helper routine that clones this composite's sub-expressions.
CompositeExpression
  
getString(op:String = null):String
Returns a string representation of this composite's sub-expressions.
CompositeExpression
Property detail
_childrenproperty
protected var _children:Array

Array of sub-expressions.

numChildrenproperty 
numChildren:int  [read-only]

The number of sub-expressions that are children of this expression.

Implementation
    public function get numChildren():int
Constructor detail
CompositeExpression()constructor
public function CompositeExpression(items:Object = null)

Creates a new CompositeExpression.

Parameters
items:Object (default = null) — either a single sub-expression or an array of sub-expressions
Method detail
addChild()method
public function addChild(expr:Expression):void

Adds an additional sub-expression to this composite.

Parameters
expr:Expression — the sub-expression to add.
cloneHelper()method 
protected function cloneHelper(ce:CompositeExpression):Expression

Helper routine that clones this composite's sub-expressions.

Parameters
ce:CompositeExpression — the cloned composite expression

Returns
Expression — the input expression
getChildAt()method 
public override function getChildAt(idx:int):Expression

Returns the sub-expression at the given index.

Parameters
idx:int — the index of the child sub-expression

Returns
Expression — the requested sub-expression.
getString()method 
protected function getString(op:String = null):String

Returns a string representation of this composite's sub-expressions.

Parameters
op:String (default = null) — a string describing the sub-class operator (null by default). If non-null, the operator string will be interspersed between sub-expression values in the output string.

Returns
String — the requested string
removeAllChildren()method 
public function removeAllChildren():void

Removes all sub-expressions from this composite.

removeChild()method 
public function removeChild(expr:Expression):Boolean

Removes a sub-expression from this composite.

Parameters
expr:Expression — the sub-epxressions to remove

Returns
Boolean — true if the expression was found and removed, false otherwise
setChildAt()method 
public override 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
setChildren()method 
public function setChildren(array:Array):void

Sets the sub-expressions of this composite

Parameters
array:Array — an array of sub-expressions