Package org.qdl_lang.evaluate
Class MathEvaluator
- java.lang.Object
-
- org.qdl_lang.evaluate.AbstractEvaluator
-
- org.qdl_lang.evaluate.MathEvaluator
-
- All Implemented Interfaces:
Serializable
,EvaluatorInterface
public class MathEvaluator extends AbstractEvaluator
Created by Jeff Gaynor
on 1/16/20 at 9:18 AM- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.qdl_lang.evaluate.AbstractEvaluator
AbstractEvaluator.CommonKeyIterator, AbstractEvaluator.fPointer, AbstractEvaluator.fpResult
-
-
Field Summary
-
Fields inherited from class org.qdl_lang.evaluate.AbstractEvaluator
bigArgList, bigArgList0, FILE_OP_AUTO, FILE_OP_BINARY, FILE_OP_INPUT_STREAM, FILE_OP_TEXT_INI, FILE_OP_TEXT_STEM, FILE_OP_TEXT_STRING, FILE_OP_TEXT_WITHOUT_LIST_INI, fNames, MAX_ARG_COUNT
-
Fields inherited from interface org.qdl_lang.evaluate.EvaluatorInterface
UNKNOWN_VALUE
-
-
Constructor Summary
Constructors Constructor Description MathEvaluator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
dispatch(Polyad polyad, State state)
Does the actual evaluation of thePolyad
.protected void
doAbs(Polyad polyad, State state)
protected QDLSet
doCodec(Polyad polyad, QDLSet inSet, AbstractCodec codec, boolean isEncode)
protected QDLStem
doCodec(Polyad polyad, QDLStem inStem, AbstractCodec codec, boolean isEncode)
protected void
doDates(Polyad polyad, State state, boolean isInMillis)
protected void
doHash(Polyad polyad, State state)
protected void
doIdentityFunction(Polyad polyad, State state)
The identity function returns its argument.protected void
doMax(Polyad polyad, State state)
protected void
doMin(Polyad polyad, State state)
protected void
doMinOrMax(Polyad polyad, State state, boolean isMax)
protected void
doModulus(Polyad polyad, State state)
Compute the modulus of two numbers, i.e.protected void
doNumericDigits(Polyad polyad, State state)
protected void
doRandom(Polyad polyad, State state)
protected void
doRandomString(Polyad polyad, State state)
String[]
getFunctionNames()
String
getNamespace()
int
getType(String name)
protected String
hashIt(String token, String algorithm)
static boolean
isIntegerValue(BigDecimal bd)
-
Methods inherited from class org.qdl_lang.evaluate.AbstractEvaluator
areAllBigDecimals, areAllBoolean, areAllLongs, areAllNumbers, areAllSets, areAllStems, areAllStrings, areAnyBigDecimals, areNoneStems, bdEquals, checkNull, checkNull, convertArgsToStem, evaluate, evaluate, finishExpr, getBigArgList, getBigArgList0, getCommonKeys, getFQFunctionNames, getFunctionReferenceNode, getFunctionReferenceNode, getOperator, getOrCreateStem, isBigDecimal, isBoolean, isBuiltInFunction, isFunctionRef, isLong, isNumber, isScalar, isSet, isStem, isStemList, isString, listFunctions, process1, process2, process2, process3, processSet1, processSet2, processSet2, processStem1, processStem2, processStem3, resolveResourceToFile, tempFname, toBD, toConstants, toStem
-
-
-
-
Field Detail
-
MATH_NAMESPACE
public static final String MATH_NAMESPACE
- See Also:
- Constant Field Values
-
MATH_FUNCTION_BASE_VALUE
public static final int MATH_FUNCTION_BASE_VALUE
- See Also:
- Constant Field Values
-
ABS_VALUE
public static final String ABS_VALUE
- See Also:
- Constant Field Values
-
ABS_VALUE_TYPE
public static final int ABS_VALUE_TYPE
- See Also:
- Constant Field Values
-
RANDOM
public static final String RANDOM
- See Also:
- Constant Field Values
-
RANDOM_TYPE
public static final int RANDOM_TYPE
- See Also:
- Constant Field Values
-
RANDOM_STRING
public static final String RANDOM_STRING
- See Also:
- Constant Field Values
-
RANDOM_STRING_TYPE
public static final int RANDOM_STRING_TYPE
- See Also:
- Constant Field Values
-
HASH
public static final String HASH
- See Also:
- Constant Field Values
-
HASH_TYPE
public static final int HASH_TYPE
- See Also:
- Constant Field Values
-
ENCODE
public static final String ENCODE
- See Also:
- Constant Field Values
-
ENCODE_TYPE
public static final int ENCODE_TYPE
- See Also:
- Constant Field Values
-
DECODE
public static final String DECODE
- See Also:
- Constant Field Values
-
DECODE_TYPE
public static final int DECODE_TYPE
- See Also:
- Constant Field Values
-
DATE_MS
public static final String DATE_MS
- See Also:
- Constant Field Values
-
DATE_MS_TYPE
public static final int DATE_MS_TYPE
- See Also:
- Constant Field Values
-
MOD
public static final String MOD
- See Also:
- Constant Field Values
-
MOD_TYPE
public static final int MOD_TYPE
- See Also:
- Constant Field Values
-
DATE_ISO
public static final String DATE_ISO
- See Also:
- Constant Field Values
-
DATE_ISO_TYPE
public static final int DATE_ISO_TYPE
- See Also:
- Constant Field Values
-
NUMERIC_DIGITS
public static final String NUMERIC_DIGITS
- See Also:
- Constant Field Values
-
NUMERIC_DIGITS_TYPE
public static final int NUMERIC_DIGITS_TYPE
- See Also:
- Constant Field Values
-
IDENTITY_FUNCTION
public static final String IDENTITY_FUNCTION
- See Also:
- Constant Field Values
-
LONG_IDENTITY_FUNCTION
public static final String LONG_IDENTITY_FUNCTION
- See Also:
- Constant Field Values
-
IDENTITY_FUNCTION_TYPE
public static final int IDENTITY_FUNCTION_TYPE
- See Also:
- Constant Field Values
-
MIN
public static final String MIN
- See Also:
- Constant Field Values
-
MIND_TYPE
public static final int MIND_TYPE
- See Also:
- Constant Field Values
-
MAX
public static final String MAX
- See Also:
- Constant Field Values
-
MAX_TYPE
public static final int MAX_TYPE
- See Also:
- Constant Field Values
-
HASH_ALGORITHM_MD2
public static final String HASH_ALGORITHM_MD2
- See Also:
- Constant Field Values
-
HASH_ALGORITHM_MD5
public static final String HASH_ALGORITHM_MD5
- See Also:
- Constant Field Values
-
HASH_ALGORITHM_SHA1
public static final String HASH_ALGORITHM_SHA1
- See Also:
- Constant Field Values
-
HASH_ALGORITHM_SHA2
public static final String HASH_ALGORITHM_SHA2
- See Also:
- Constant Field Values
-
HASH_ALGORITHM_SHA_256
public static final String HASH_ALGORITHM_SHA_256
- See Also:
- Constant Field Values
-
HASH_ALGORITHM_SHA_384
public static final String HASH_ALGORITHM_SHA_384
- See Also:
- Constant Field Values
-
HASH_ALGORITHM_SHA_512
public static final String HASH_ALGORITHM_SHA_512
- See Also:
- Constant Field Values
-
-
Method Detail
-
getNamespace
public String getNamespace()
-
getFunctionNames
public String[] getFunctionNames()
- Specified by:
getFunctionNames
in classAbstractEvaluator
-
getType
public int getType(String name)
-
dispatch
public boolean dispatch(Polyad polyad, State state)
Description copied from class:AbstractEvaluator
Does the actual evaluation of thePolyad
.- Specified by:
dispatch
in classAbstractEvaluator
- Returns:
-
doCodec
protected QDLSet doCodec(Polyad polyad, QDLSet inSet, AbstractCodec codec, boolean isEncode)
-
doCodec
protected QDLStem doCodec(Polyad polyad, QDLStem inStem, AbstractCodec codec, boolean isEncode)
-
doIdentityFunction
protected void doIdentityFunction(Polyad polyad, State state)
The identity function returns its argument. Simple as that.- Parameters:
polyad
-state
-
-
doModulus
protected void doModulus(Polyad polyad, State state)
Compute the modulus of two numbers, i.e. the remainder after division- Parameters:
polyad
-
-
isIntegerValue
public static boolean isIntegerValue(BigDecimal bd)
-
-