Packageflare.query
Classpublic class Arithmetic
InheritanceArithmetic Inheritance BinaryExpression Inheritance Expression

Expression operator for arithmetic operations. Performs addition, subtraction, multiplication, or division of sub-expression values.



Public Properties
 PropertyDefined by
 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.
Arithmetic
 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
  
Arithmetic(op:int, left:*, right:*)
Create a new Arithmetic expression.
Arithmetic
  
Add(left:*, right:*):Arithmetic
[static] Creates a new Arithmetic operator for adding two numbers.
Arithmetic
  
Creates a cloned copy of the expression.
Arithmetic
  
Divide(left:*, right:*):Arithmetic
[static] Creates a new Arithmetic operator for dividing one number by another.
Arithmetic
  
eval(o:Object = null):*
Evaluates this expression with the given input object.
Arithmetic
 Inherited
[static] Utility method that maps an input value into an Expression.
Expression
 Inherited
Returns the sub-expression at the given index.
BinaryExpression
  
Mod(left:*, right:*):Arithmetic
[static] Creates a new Arithmetic operator for computing the modulo (remainder) of a number.
Arithmetic
  
Multiply(left:*, right:*):Arithmetic
[static] Creates a new Arithmetic operator for multiplying two numbers.
Arithmetic
 Inherited
predicate(o:Object):Boolean
Boolean predicate that tests the output of evaluating this expression.
Expression
 Inherited
setChildAt(idx:int, expr:Expression):Boolean
Set the sub-expression at the given index.
BinaryExpression
  
Subtract(left:*, right:*):Arithmetic
[static] Creates a new Arithmetic operator for subtracting one number from another.
Arithmetic
 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
  ADD : int = 0
[static] Indicates an addition operation.
Arithmetic
  DIV : int = 3
[static] Indicates a division operation.
Arithmetic
  MOD : int = 4
[static] Indicates a modulo operation.
Arithmetic
  MUL : int = 2
[static] Indicates a multiplication operation.
Arithmetic
  SUB : int = 1
[static] Indicates a subtraction operation.
Arithmetic
Property detail
operatorStringproperty
operatorString:String  [read-only]

Returns a string representation of the arithmetic operator.

Implementation
    public function get operatorString():String
Constructor detail
Arithmetic()constructor
public function Arithmetic(op:int, left:*, right:*)

Create a new Arithmetic expression.

Parameters
op:int — the operation to perform
 
left:* — the left sub-expression
 
right:* — the right sub-expression
Method detail
Add()method
public static function Add(left:*, right:*):Arithmetic

Creates a new Arithmetic operator for adding two numbers.

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

Returns
Arithmetic — the new Arithmetic operator
clone()method 
public override function clone():Expression

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

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

Creates a new Arithmetic operator for dividing one number by another.

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

Returns
Arithmetic — the new Arithmetic 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
Mod()method 
public static function Mod(left:*, right:*):Arithmetic

Creates a new Arithmetic operator for computing the modulo (remainder) of a number.

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

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

Creates a new Arithmetic operator for multiplying two numbers.

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

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

Creates a new Arithmetic operator for subtracting one number from another.

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

Returns
Arithmetic — the new Arithmetic operator
Constant detail
ADDconstant
public static const ADD:int = 0

Indicates an addition operation.

DIVconstant 
public static const DIV:int = 3

Indicates a division operation.

MODconstant 
public static const MOD:int = 4

Indicates a modulo operation.

MULconstant 
public static const MUL:int = 2

Indicates a multiplication operation.

SUBconstant 
public static const SUB:int = 1

Indicates a subtraction operation.