Package org.qdl_lang.evaluate
Class StringEvaluator
- java.lang.Object
-
- org.qdl_lang.evaluate.AbstractEvaluator
-
- org.qdl_lang.evaluate.StringEvaluator
-
- All Implemented Interfaces:
Serializable,EvaluatorInterface
public class StringEvaluator extends AbstractEvaluator
This evaluates all string functions.Created by Jeff Gaynor
on 1/16/20 at 9:17 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 Modifier and Type Field Description static StringCAPUTstatic intCAPUT_TYPEstatic StringCONTAINSstatic intCONTAINS_TYPEstatic StringDETOKENIZEstatic LongDETOKENIZE_OMIT_DANGLING_DELIMITER_VALUEstatic LongDETOKENIZE_PREPEND_VALUEstatic intDETOKENIZE_TYPEstatic StringDIFFstatic intDIFF_TYPEstatic StringFROM_URIstatic intFROM_URI_TYPEstatic StringINDEX_OFstatic intINDEX_OF_TYPEstatic StringINSERTstatic intINSERT_TYPEstatic StringREPLACEstatic intREPLACE_TYPEstatic StringSTRING_FQstatic intSTRING_FUNCTION_BASE_VALUEstatic StringSTRING_NAMESPACEstatic StringSUBSTRINGstatic intSUBSTRING_TYPEstatic StringTAILstatic intTAIL_TYPEstatic StringTO_LOWERstatic intTO_LOWER_TYPEstatic StringTO_UPPERstatic intTO_UPPER_TYPEstatic StringTO_URIstatic intTO_URI_TYPEstatic StringTOKENIZEstatic intTOKENIZE_TYPEstatic StringTRIMstatic intTRIM_TYPE-
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 StringEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandispatch(Polyad polyad, State state)Does the actual evaluation of thePolyad.protected voiddoCaput(Polyad polyad, State state)protected voiddoContains(Polyad polyad, State state)protected voiddoDetokeninze(Polyad polyad, State state)protected voiddoDiff(Polyad polyad, State state)protected voiddoIndexOf(Polyad polyad, State state)protected voiddoInsert(Polyad polyad, State state)protected voiddoOldReplace(Polyad polyad, State state)protected voiddoReplace(Polyad polyad, State state)protected QDLSetdoReplace(Polyad polyad, QDLSet<QDLValue> inSet, QDLStem replacements, QDLStem regexStem, State state)protected QDLStemdoReplace(Polyad polyad, QDLStem inStem, QDLStem replacements, QDLStem regexStem, State state)Do replace where there is an arbitrary stem and a stem of replacements and regexes The keys for the replacements and regexes correspond, and the replacements happen to every elements if inStem, the target of the replacement.protected StringdoStringReplace(String s, QDLStem replacements, QDLStem regexStem)protected voiddoSubstring(Polyad polyad, State state)protected voiddoSwapCase(Polyad polyad, State state, boolean isLower)protected voiddoTail(Polyad polyad, State state)protected voiddoTokenize(Polyad polyad, State state)protected voiddoTrim(Polyad polyad, State state)String[]getFunctionNames()StringgetNamespace()intgetType(String name)-
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, NEWgetOperator, OLDgetOperator, process1, process2, process2, process3, processSet1, processSet2, processSet2, processStem1, processStem2, processStem3, resolveResourceToFile, tempFname, toBD, toConstants, toStem
-
-
-
-
Field Detail
-
STRING_NAMESPACE
public static final String STRING_NAMESPACE
- See Also:
- Constant Field Values
-
STRING_FQ
public static final String STRING_FQ
- See Also:
- Constant Field Values
-
STRING_FUNCTION_BASE_VALUE
public static final int STRING_FUNCTION_BASE_VALUE
- See Also:
- Constant Field Values
-
CONTAINS
public static final String CONTAINS
- See Also:
- Constant Field Values
-
CONTAINS_TYPE
public static final int CONTAINS_TYPE
- See Also:
- Constant Field Values
-
TO_LOWER
public static final String TO_LOWER
- See Also:
- Constant Field Values
-
TO_LOWER_TYPE
public static final int TO_LOWER_TYPE
- See Also:
- Constant Field Values
-
TO_UPPER
public static final String TO_UPPER
- See Also:
- Constant Field Values
-
TO_UPPER_TYPE
public static final int TO_UPPER_TYPE
- See Also:
- Constant Field Values
-
TRIM
public static final String TRIM
- See Also:
- Constant Field Values
-
TRIM_TYPE
public static final int TRIM_TYPE
- See Also:
- Constant Field Values
-
INSERT
public static final String INSERT
- See Also:
- Constant Field Values
-
INSERT_TYPE
public static final int INSERT_TYPE
- See Also:
- Constant Field Values
-
SUBSTRING
public static final String SUBSTRING
- See Also:
- Constant Field Values
-
SUBSTRING_TYPE
public static final int SUBSTRING_TYPE
- See Also:
- Constant Field Values
-
REPLACE
public static final String REPLACE
- See Also:
- Constant Field Values
-
REPLACE_TYPE
public static final int REPLACE_TYPE
- See Also:
- Constant Field Values
-
INDEX_OF
public static final String INDEX_OF
- See Also:
- Constant Field Values
-
INDEX_OF_TYPE
public static final int INDEX_OF_TYPE
- See Also:
- Constant Field Values
-
TOKENIZE
public static final String TOKENIZE
- See Also:
- Constant Field Values
-
TOKENIZE_TYPE
public static final int TOKENIZE_TYPE
- See Also:
- Constant Field Values
-
DETOKENIZE
public static final String DETOKENIZE
- See Also:
- Constant Field Values
-
DETOKENIZE_TYPE
public static final int DETOKENIZE_TYPE
- See Also:
- Constant Field Values
-
TO_URI
public static final String TO_URI
- See Also:
- Constant Field Values
-
TO_URI_TYPE
public static final int TO_URI_TYPE
- See Also:
- Constant Field Values
-
FROM_URI
public static final String FROM_URI
- See Also:
- Constant Field Values
-
FROM_URI_TYPE
public static final int FROM_URI_TYPE
- See Also:
- Constant Field Values
-
CAPUT
public static final String CAPUT
- See Also:
- Constant Field Values
-
CAPUT_TYPE
public static final int CAPUT_TYPE
- See Also:
- Constant Field Values
-
DIFF
public static final String DIFF
- See Also:
- Constant Field Values
-
DIFF_TYPE
public static final int DIFF_TYPE
- See Also:
- Constant Field Values
-
TAIL
public static final String TAIL
- See Also:
- Constant Field Values
-
TAIL_TYPE
public static final int TAIL_TYPE
- See Also:
- Constant Field Values
-
DETOKENIZE_PREPEND_VALUE
public static final Long DETOKENIZE_PREPEND_VALUE
-
DETOKENIZE_OMIT_DANGLING_DELIMITER_VALUE
public static final Long DETOKENIZE_OMIT_DANGLING_DELIMITER_VALUE
-
-
Method Detail
-
getNamespace
public String getNamespace()
-
getFunctionNames
public String[] getFunctionNames()
- Specified by:
getFunctionNamesin classAbstractEvaluator
-
getType
public int getType(String name)
-
dispatch
public boolean dispatch(Polyad polyad, State state)
Description copied from class:AbstractEvaluatorDoes the actual evaluation of thePolyad.- Specified by:
dispatchin classAbstractEvaluator- Returns:
-
doReplace
protected QDLStem doReplace(Polyad polyad, QDLStem inStem, QDLStem replacements, QDLStem regexStem, State state)
Do replace where there is an arbitrary stem and a stem of replacements and regexes The keys for the replacements and regexes correspond, and the replacements happen to every elements if inStem, the target of the replacement.- Parameters:
polyad-inStem-replacements-regexStem-state-- Returns:
-
doReplace
protected QDLSet doReplace(Polyad polyad, QDLSet<QDLValue> inSet, QDLStem replacements, QDLStem regexStem, State state)
-
doStringReplace
protected String doStringReplace(String s, QDLStem replacements, QDLStem regexStem)
-
-