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.AbstractEvaluatorAbstractEvaluator.CommonKeyIterator, AbstractEvaluator.fPointer, AbstractEvaluator.fpResult
 
- 
 - 
Field Summary- 
Fields inherited from class org.qdl_lang.evaluate.AbstractEvaluatorbigArgList, 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.EvaluatorInterfaceUNKNOWN_VALUE
 
- 
 - 
Constructor SummaryConstructors Constructor Description MathEvaluator()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandispatch(Polyad polyad, State state)Does the actual evaluation of thePolyad.protected voiddoAbs(Polyad polyad, State state)protected QDLSetdoCodec(Polyad polyad, QDLSet<QDLValue> inSet, AbstractCodec codec, boolean isEncode)protected QDLStemdoCodec(Polyad polyad, QDLStem inStem, AbstractCodec codec, boolean isEncode)protected voiddoDates(Polyad polyad, State state, boolean isInMillis)protected voiddoHash(Polyad polyad, State state)protected voiddoIdentityFunction(Polyad polyad, State state)The identity function returns its argument.protected voiddoMax(Polyad polyad, State state)protected voiddoMin(Polyad polyad, State state)protected voiddoMinOrMax(Polyad polyad, State state, boolean isMax)protected voiddoModulus(Polyad polyad, State state)Compute the modulus of two numbers, i.e.protected voiddoNumericDigits(Polyad polyad, State state)protected voiddoRandom(Polyad polyad, State state)protected voiddoRandomString(Polyad polyad, State state)String[]getFunctionNames()StringgetNamespace()intgetType(String name)protected StringhashIt(String token, String algorithm)static booleanisIntegerValue(BigDecimal bd)- 
Methods inherited from class org.qdl_lang.evaluate.AbstractEvaluatorareAllBigDecimals, 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, NEWgetOperator, OLDgetOperator, process1, process2, process2, process3, processSet1, processSet2, processSet2, processStem1, processStem2, processStem3, resolveResourceToFile, tempFname, toBD, toConstants, toStem
 
- 
 
- 
- 
- 
Field Detail- 
MATH_NAMESPACEpublic static final String MATH_NAMESPACE - See Also:
- Constant Field Values
 
 - 
MATH_FUNCTION_BASE_VALUEpublic static final int MATH_FUNCTION_BASE_VALUE - See Also:
- Constant Field Values
 
 - 
ABS_VALUEpublic static final String ABS_VALUE - See Also:
- Constant Field Values
 
 - 
ABS_VALUE_TYPEpublic static final int ABS_VALUE_TYPE - See Also:
- Constant Field Values
 
 - 
RANDOMpublic static final String RANDOM - See Also:
- Constant Field Values
 
 - 
RANDOM_TYPEpublic static final int RANDOM_TYPE - See Also:
- Constant Field Values
 
 - 
RANDOM_STRINGpublic static final String RANDOM_STRING - See Also:
- Constant Field Values
 
 - 
RANDOM_STRING_TYPEpublic static final int RANDOM_STRING_TYPE - See Also:
- Constant Field Values
 
 - 
HASHpublic static final String HASH - See Also:
- Constant Field Values
 
 - 
HASH_TYPEpublic static final int HASH_TYPE - See Also:
- Constant Field Values
 
 - 
ENCODEpublic static final String ENCODE - See Also:
- Constant Field Values
 
 - 
ENCODE_TYPEpublic static final int ENCODE_TYPE - See Also:
- Constant Field Values
 
 - 
DECODEpublic static final String DECODE - See Also:
- Constant Field Values
 
 - 
DECODE_TYPEpublic static final int DECODE_TYPE - See Also:
- Constant Field Values
 
 - 
DATE_MSpublic static final String DATE_MS - See Also:
- Constant Field Values
 
 - 
DATE_MS_TYPEpublic static final int DATE_MS_TYPE - See Also:
- Constant Field Values
 
 - 
MODpublic static final String MOD - See Also:
- Constant Field Values
 
 - 
MOD_TYPEpublic static final int MOD_TYPE - See Also:
- Constant Field Values
 
 - 
DATE_ISOpublic static final String DATE_ISO - See Also:
- Constant Field Values
 
 - 
DATE_ISO_TYPEpublic static final int DATE_ISO_TYPE - See Also:
- Constant Field Values
 
 - 
NUMERIC_DIGITSpublic static final String NUMERIC_DIGITS - See Also:
- Constant Field Values
 
 - 
NUMERIC_DIGITS_TYPEpublic static final int NUMERIC_DIGITS_TYPE - See Also:
- Constant Field Values
 
 - 
IDENTITY_FUNCTIONpublic static final String IDENTITY_FUNCTION - See Also:
- Constant Field Values
 
 - 
LONG_IDENTITY_FUNCTIONpublic static final String LONG_IDENTITY_FUNCTION - See Also:
- Constant Field Values
 
 - 
IDENTITY_FUNCTION_TYPEpublic static final int IDENTITY_FUNCTION_TYPE - See Also:
- Constant Field Values
 
 - 
MINpublic static final String MIN - See Also:
- Constant Field Values
 
 - 
MIND_TYPEpublic static final int MIND_TYPE - See Also:
- Constant Field Values
 
 - 
MAXpublic static final String MAX - See Also:
- Constant Field Values
 
 - 
MAX_TYPEpublic static final int MAX_TYPE - See Also:
- Constant Field Values
 
 - 
HASH_ALGORITHM_MD2public static final String HASH_ALGORITHM_MD2 - See Also:
- Constant Field Values
 
 - 
HASH_ALGORITHM_MD5public static final String HASH_ALGORITHM_MD5 - See Also:
- Constant Field Values
 
 - 
HASH_ALGORITHM_SHA1public static final String HASH_ALGORITHM_SHA1 - See Also:
- Constant Field Values
 
 - 
HASH_ALGORITHM_SHA2public static final String HASH_ALGORITHM_SHA2 - See Also:
- Constant Field Values
 
 - 
HASH_ALGORITHM_SHA_256public static final String HASH_ALGORITHM_SHA_256 - See Also:
- Constant Field Values
 
 - 
HASH_ALGORITHM_SHA_384public static final String HASH_ALGORITHM_SHA_384 - See Also:
- Constant Field Values
 
 - 
HASH_ALGORITHM_SHA_512public static final String HASH_ALGORITHM_SHA_512 - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getNamespacepublic String getNamespace() 
 - 
getFunctionNamespublic String[] getFunctionNames() - Specified by:
- getFunctionNamesin class- AbstractEvaluator
 
 - 
getTypepublic int getType(String name) 
 - 
dispatchpublic boolean dispatch(Polyad polyad, State state) Description copied from class:AbstractEvaluatorDoes the actual evaluation of thePolyad.- Specified by:
- dispatchin class- AbstractEvaluator
- Returns:
 
 - 
doCodecprotected QDLSet doCodec(Polyad polyad, QDLSet<QDLValue> inSet, AbstractCodec codec, boolean isEncode) 
 - 
doCodecprotected QDLStem doCodec(Polyad polyad, QDLStem inStem, AbstractCodec codec, boolean isEncode) 
 - 
doIdentityFunctionprotected void doIdentityFunction(Polyad polyad, State state) The identity function returns its argument. Simple as that.- Parameters:
- polyad-
- state-
 
 - 
doModulusprotected void doModulus(Polyad polyad, State state) Compute the modulus of two numbers, i.e. the remainder after division- Parameters:
- polyad-
 
 - 
isIntegerValuepublic static boolean isIntegerValue(BigDecimal bd) 
 
- 
 
-