public class ArithmeticFunctionToken extends java.lang.Object implements PatternToken
Modifier and Type | Class and Description |
---|---|
protected static class |
ArithmeticFunctionToken.FunctionType
Function type
|
Modifier and Type | Field and Description |
---|---|
protected ArithmeticFunctionToken.FunctionType |
function
Function type
|
protected PatternToken |
operand
Operand
|
Constructor and Description |
---|
ArithmeticFunctionToken(java.lang.String functionString,
PatternToken operand)
Currently, this class recognizes only the "log" function, which is "ln" in fact.
|
Modifier and Type | Method and Description |
---|---|
float |
evaluate(float[] subdistances)
Apply the arithmetic function on the argument evaluated on the passed subdistances.
|
static boolean |
isFunctionString(java.lang.String functionString)
This static method should be in compliance with types recognized by consructor - LOG (for ln), LOG10 (for log_10).
|
java.lang.String |
toString() |
protected final ArithmeticFunctionToken.FunctionType function
protected final PatternToken operand
public ArithmeticFunctionToken(java.lang.String functionString, PatternToken operand) throws java.lang.IllegalArgumentException
functionString
- string to be parsedoperand
- already created tokenjava.lang.IllegalArgumentException
public static boolean isFunctionString(java.lang.String functionString)
functionString
- string to checkpublic final float evaluate(float[] subdistances)
evaluate
in interface PatternToken
subdistances
- specific subdistances for the two meta objects comparedpublic java.lang.String toString()
toString
in class java.lang.Object