JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.formulae
Class Operation

java.lang.Object
  |
  +--com.klg.jclass.util.formulae.Operation
All Implemented Interfaces:
Cloneable, Expression
Direct Known Subclasses:
Abs, Add, Average, Ceiling, Count, Divide, Floor, GeometricMean, Max, Median, Min, Multiply, Power, Product, Remainder, Root, Round, Sort, StdDeviation, Subtract, Sum, Trunc

public abstract class Operation
extends Object
implements Expression, Cloneable

The Operation class defines the basic elements of an operator. All operators have (at least potentially) a left and right operand; this allows the correct ordering to be applied to matrix operations and any other non-commutative operators. NOTE: The issue of cycle detection still needs to be addressed


Field Summary
 com.klg.jclass.util.formulae.Expression leftOperand
          The operand on the left side of the operator for binary operations; the only operand for unary operations
 com.klg.jclass.util.formulae.Expression rightOperand
          The operand on the right side of the operator for binary operations
 
Constructor Summary
Operation()
          Constructor for a generic operator with no operands
Operation(com.klg.jclass.util.formulae.Expression operand)
          Constructor for a unary or List operator
Operation(com.klg.jclass.util.formulae.Expression left, com.klg.jclass.util.formulae.Expression right)
          Constructor for a binary operator
Operation(com.klg.jclass.util.formulae.Expression left, Number right)
          Constructor for a binary operator given an Expression and a Number
Operation(Number num)
          Constructor for a unary operator taking a Number
Operation(Number left, com.klg.jclass.util.formulae.Expression right)
          Constructor for a binary operator given a Number and an Expression
Operation(Number left, Number right)
          Constructor for a binary operator given a pair of Numbers
 
Method Summary
 Object clone()
          Return an Expression which is a clone of this Operation (all operands are also cloned)
abstract  com.klg.jclass.util.formulae.Result evaluate()
          Evaluate the Operation, returning the result.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leftOperand

public com.klg.jclass.util.formulae.Expression leftOperand
The operand on the left side of the operator for binary operations; the only operand for unary operations


rightOperand

public com.klg.jclass.util.formulae.Expression rightOperand
The operand on the right side of the operator for binary operations

Constructor Detail

Operation

public Operation()
Constructor for a generic operator with no operands


Operation

public Operation(com.klg.jclass.util.formulae.Expression operand)
Constructor for a unary or List operator

Parameters:
operand - An Expression to be transformed by a unary or aggregation operation

Operation

public Operation(Number num)
Constructor for a unary operator taking a Number

Parameters:
num - A Number on which to perform a unary operation

Operation

public Operation(com.klg.jclass.util.formulae.Expression left,
                 com.klg.jclass.util.formulae.Expression right)
Constructor for a binary operator

Parameters:
left - The Expression on the left-hand side of the operation
right - The Expression on the right-hand side of the operation

Operation

public Operation(com.klg.jclass.util.formulae.Expression left,
                 Number right)
Constructor for a binary operator given an Expression and a Number

Parameters:
left - The Expression on the left-hand side of the operation
right - A Number for the right-hand side of the operation

Operation

public Operation(Number left,
                 com.klg.jclass.util.formulae.Expression right)
Constructor for a binary operator given a Number and an Expression

Parameters:
left - A Number for the left-hand side of the operation
right - The Expression on the right-hand side of the operation

Operation

public Operation(Number left,
                 Number right)
Constructor for a binary operator given a pair of Numbers

Parameters:
left - A Number for the left-hand side of the operation
right - A Number for the right-hand side of the operation
Method Detail

evaluate

public abstract com.klg.jclass.util.formulae.Result evaluate()
Evaluate the Operation, returning the result.

Specified by:
evaluate in interface Expression
Returns:
The result of evaluating this operation on the current operands

clone

public Object clone()
Return an Expression which is a clone of this Operation (all operands are also cloned)

Specified by:
clone in interface Expression
Overrides:
clone in class Object

Copyright © 2004 Quest Software Inc..
All rights reserved.