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 String
CAPUT
static int
CAPUT_TYPE
static String
CONTAINS
static int
CONTAINS_TYPE
static String
DETOKENIZE
static Long
DETOKENIZE_OMIT_DANGLING_DELIMITER_VALUE
static Long
DETOKENIZE_PREPEND_VALUE
static int
DETOKENIZE_TYPE
static String
DIFF
static int
DIFF_TYPE
static String
FROM_URI
static int
FROM_URI_TYPE
static String
INDEX_OF
static int
INDEX_OF_TYPE
static String
INSERT
static int
INSERT_TYPE
static String
REPLACE
static int
REPLACE_TYPE
static String
STRING_FQ
static int
STRING_FUNCTION_BASE_VALUE
static String
STRING_NAMESPACE
static String
SUBSTRING
static int
SUBSTRING_TYPE
static String
TAIL
static int
TAIL_TYPE
static String
TO_LOWER
static int
TO_LOWER_TYPE
static String
TO_UPPER
static int
TO_UPPER_TYPE
static String
TO_URI
static int
TO_URI_TYPE
static String
TOKENIZE
static int
TOKENIZE_TYPE
static String
TRIM
static int
TRIM_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 boolean
dispatch(Polyad polyad, State state)
Does the actual evaluation of thePolyad
.protected void
doCaput(Polyad polyad, State state)
protected void
doContains(Polyad polyad, State state)
protected void
doDetokeninze(Polyad polyad, State state)
protected void
doDiff(Polyad polyad, State state)
protected void
doIndexOf(Polyad polyad, State state)
protected void
doInsert(Polyad polyad, State state)
protected void
doOldReplace(Polyad polyad, State state)
protected void
doReplace(Polyad polyad, State state)
protected QDLSet
doReplace(Polyad polyad, QDLSet inSet, QDLStem replacements, QDLStem regexStem, State state)
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.protected String
doStringReplace(String s, QDLStem replacements, QDLStem regexStem)
protected void
doSubstring(Polyad polyad, State state)
protected void
doSwapCase(Polyad polyad, State state, boolean isLower)
protected void
doTail(Polyad polyad, State state)
protected void
doTokenize(Polyad polyad, State state)
protected void
doTrim(Polyad polyad, State state)
String[]
getFunctionNames()
String
getNamespace()
int
getType(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, 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:
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:
-
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 inSet, QDLStem replacements, QDLStem regexStem, State state)
-
doStringReplace
protected String doStringReplace(String s, QDLStem replacements, QDLStem regexStem)
-
-