Packageflare.query
Classpublic class Comparison
InheritanceComparison Inheritance BinaryExpression Inheritance Expression

Expression operator for comparing sub-expression values. Performs equals, not equals, less-than, greater-than, less-than-or-equal, or greater-than-or-equal comparison.



Public Properties
 PropertyDefined by
  comparator : Function
Comparison function for custom ordering criteria.
Comparison
 Inheritedleft : Expression
The left-hand-side sub-expression.
BinaryExpression
 InheritednumChildren : int
The number of sub-expressions that are children of this expression.
BinaryExpression
 Inheritedoperator : int
Code indicating the operation performed by this instance.
BinaryExpression
  operatorString : String
[read-only] Returns a string representation of the arithmetic operator.
Comparison
 Inheritedright : Expression
The right-hand-side sub-expression.
BinaryExpression
Protected Properties
 PropertyDefined by
 Inherited_left : Expression
The left-hand-side sub-expression.
BinaryExpression
 Inherited_op : int
Code indicating the operation perfomed by this instance.
BinaryExpression
 Inherited_right : Expression
The right-hand-side sub-expression.
BinaryExpression
Public Methods
 MethodDefined by
  
Comparison(op:int = 2, left:Function, right:*, comparator:* = null)
Creates a new Comparison operator.
Comparison
  
Creates a cloned copy of the expression.
Comparison
  
Equal(left:*, right:*):Comparison
[static] Creates a new Comparison operator for an equals comparison.
Comparison
  
eval(o:Object = null):*
Evaluates this expression with the given input object.
Comparison
 Inherited
[static] Utility method that maps an input value into an Expression.
Expression
 Inherited
Returns the sub-expression at the given index.
BinaryExpression
  
GreaterThan(left:*, right:*):Comparison
[static] Creates a new Comparison operator for a greater-than comparison.
Comparison
  
GreaterThanOrEqual(left:*, right:*):Comparison
[static] Creates a new Comparison operator for a greater-than-or-equal comparison.
Comparison
  
LessThan(left:*, right:*):Comparison
[static] Creates a new Comparison operator for a less-than comparison.
Comparison
  
LessThanOrEqual(left:*, right:*):Comparison
[static] Creates a new Comparison operator for a less-than-or-equal comparison.
Comparison
  
NotEqual(left:*, right:*):Comparison
[static] Creates a new Comparison operator for a not equals comparison.
Comparison
  
predicate(o:Object):Boolean
Boolean predicate that tests the output of evaluating this expression.
Comparison
 Inherited
setChildAt(idx:int, expr:Expression):Boolean
Set the sub-expression at the given index.
BinaryExpression
 Inherited
toString():String
Returns a string representation of the expression.
BinaryExpression
 Inherited
visit(f:Function):Boolean
Sequentially invokes the input function on this expression and all sub-expressions.
Expression
Public Constants
 ConstantDefined by
  EQ : int = 2
[static] Indicates a equals comparison.
Comparison
  GT : int = 1
[static] Indicates a greater-than comparison.
Comparison
  GTEQ : int = 5
[static] Indicates a greater-than-or-equals comparison.
Comparison
  LT : int = 0
[static] Indicates a less-than comparison.
Comparison
  LTEQ : int = 4
[static] Indicates a less-than-or-equals comparison.
Comparison
  NEQ : int = 3
[static] Indicates a not-equals comparison.
Comparison
Property detail
comparatorproperty
comparator:Function  [read-write]

Comparison function for custom ordering criteria.

Implementation
    public function get comparator():Function
    public function set comparator(value:Function):void
operatorStringproperty 
operatorString:String  [read-only]

Returns a string representation of the arithmetic operator.

Implementation
    public function get operatorString():String
Constructor detail
Comparison()constructor
public function Comparison(op:int = 2, left:Function, right:*, comparator:* = null)

Creates a new Comparison operator.

Parameters
op:int (default = 2) — the left-hand-side sub-expression to compare
 
left:Function — the right-hand-side sub-expression to compare
 
right:* — a function to use for comparison (null by default)
 
comparator:* (default = null)
Method detail
clone()method
public override function clone():Expression

Creates a cloned copy of the expression. Recursively clones any sub-expressions.

Returns
Expression — the cloned expression.
Equal()method 
public static function Equal(left:*, right:*):Comparison

Creates a new Comparison operator for an equals comparison.

Parameters
left:* — the left-hand input expression
 
right:* — the right-hand input expression

Returns
Comparison — the new Comparison operator
eval()method 
public override 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
GreaterThan()method 
public static function GreaterThan(left:*, right:*):Comparison

Creates a new Comparison operator for a greater-than comparison.

Parameters
left:* — the left-hand input expression
 
right:* — the right-hand input expression

Returns
Comparison — the new Comparison operator
GreaterThanOrEqual()method 
public static function GreaterThanOrEqual(left:*, right:*):Comparison

Creates a new Comparison operator for a greater-than-or-equal comparison.

Parameters
left:* — the left-hand input expression
 
right:* — the right-hand input expression

Returns
Comparison — the new Comparison operator
LessThan()method 
public static function LessThan(left:*, right:*):Comparison

Creates a new Comparison operator for a less-than comparison.

Parameters
left:* — the left-hand input expression
 
right:* — the right-hand input expression

Returns
Comparison — the new Comparison operator
LessThanOrEqual()method 
public static function LessThanOrEqual(left:*, right:*):Comparison

Creates a new Comparison operator for a less-than-or-equal comparison.

Parameters
left:* — the left-hand input expression
 
right:* — the right-hand input expression

Returns
Comparison — the new Comparison operator
NotEqual()method 
public static function NotEqual(left:*, right:*):Comparison

Creates a new Comparison operator for a not equals comparison.

Parameters
left:* — the left-hand input expression
 
right:* — the right-hand input expression

Returns
Comparison — the new Comparison operator
predicate()method 
public override 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
Constant detail
EQconstant
public static const EQ:int = 2

Indicates a equals comparison.

GTconstant 
public static const GT:int = 1

Indicates a greater-than comparison.

GTEQconstant 
public static const GTEQ:int = 5

Indicates a greater-than-or-equals comparison.

LTconstant 
public static const LT:int = 0

Indicates a less-than comparison.

LTEQconstant 
public static const LTEQ:int = 4

Indicates a less-than-or-equals comparison.

NEQconstant 
public static const NEQ:int = 3

Indicates a not-equals comparison.