messif.objects.util.impl
Class ArithmeticOperatorToken

java.lang.Object
  extended by messif.objects.util.impl.ArithmeticOperatorToken
All Implemented Interfaces:
java.io.Serializable, PatternToken

public class ArithmeticOperatorToken
extends java.lang.Object
implements PatternToken

Arithmetic operators like "+, -, *, /" for aggregation function evaluator.

See Also:
Serialized Form

Nested Class Summary
protected static class ArithmeticOperatorToken.OperatorType
          Operator type
 
Field Summary
protected  PatternToken operand1
          First operand
protected  PatternToken operand2
          Second operand
protected  ArithmeticOperatorToken.OperatorType operator
          Operator type
 
Constructor Summary
ArithmeticOperatorToken(PatternToken operand1, java.lang.String operator, PatternToken operand2)
          Constructs the object given two already created operands and operator string: "+", "-", "*", "/".
 
Method Summary
 float evaluate(float[] subdistances)
          Evalutes the arithmetic operator on its operands given a specific subdistances for the two meta objects compared
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

operand1

protected final PatternToken operand1
First operand


operator

protected final ArithmeticOperatorToken.OperatorType operator
Operator type


operand2

protected final PatternToken operand2
Second operand

Constructor Detail

ArithmeticOperatorToken

public ArithmeticOperatorToken(PatternToken operand1,
                               java.lang.String operator,
                               PatternToken operand2)
                        throws java.lang.IllegalArgumentException
Constructs the object given two already created operands and operator string: "+", "-", "*", "/".

Parameters:
operand1 - first operand
operator - operator function "+", "-", "*", "/".
operand2 - second operand
Throws:
java.lang.IllegalArgumentException
Method Detail

evaluate

public final float evaluate(float[] subdistances)
Evalutes the arithmetic operator on its operands given a specific subdistances for the two meta objects compared

Specified by:
evaluate in interface PatternToken
Parameters:
subdistances - specific subdistances for the two meta objects compared
Returns:
result of the arithmetic operation

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object