Class ExpressionUtils
java.lang.Object
org.mariuszgromada.math.mxparser.ExpressionUtils
Utility methods used in Expression class
- Version:
- 6.1.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final String(package private) static final booleanprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidaddArgumentsKeyWords(List<Argument> argumentsList, List<KeyWord> keyWordsList) (package private) static voidaddConstantsKeyWords(List<Constant> constantsList, List<KeyWord> keyWordsList) (package private) static voidaddFunctionsKeyWords(List<Function> functionsList, List<KeyWord> keyWordsList) (package private) static voidaddKeyWord(String wordString, String wordDescription, int wordId, String wordSyntax, String wordSince, int wordTypeId, List<KeyWord> keyWordsList) (package private) static voidaddKeyWordUnicode(String wordString, String wordDescription, int wordId, String wordSyntax, String wordSince, int wordTypeId, boolean unicodeKeyWordsEnabled, List<KeyWord> keyWordsList) (package private) static voidaddParserKeyWords(boolean parserKeyWordsOnly, boolean UDFExpression, boolean unicodeKeyWordsEnabled, List<KeyWord> keyWordsList) (package private) static voidaddUDFSpecificParserKeyWords(List<KeyWord> keyWordsList) private static StringbuildHelpCaption(String query) private static StringbuildHelpSearchLine(KeyWord kw, boolean advancedSearch) private static voidbuildHtmlTableRows(List<KeyWord> keyWordsList, boolean addHeader, StringBuilder stringBuilder) private static voidbuildJsonRows(List<KeyWord> keyWordsList, StringBuilder stringBuilder) private static voidbuildMarkdownTableRows(List<KeyWord> keyWordsList, boolean addHeader, StringBuilder stringBuilder) private static booleancheckIfAdvancedSearch(String query) (package private) static StringcleanExpressionString(String expressionString, boolean attemptToFixExpStrEnabled) Cleans blanks and other cases like "++', "+-", "-+", "--"private static StringcleanMinusMinus(String expressionString) Cleans "--" case considering defined parser keywords "-->", "invalid input: '<'--"cloneForThreadSafeArgumenstList(Expression relatedExpressionThatInitiatedClone, List<Argument> argumentsListToClone, CloneCache cloneCache) cloneForThreadSafeConstantsList(Expression relatedExpressionThatInitiatedClone, List<Constant> constantsListToClone, CloneCache cloneCache) cloneForThreadSafeFunctionsList(Expression relatedExpressionThatInitiatedClone, List<Function> functionsListToClone, CloneCache cloneCache) private static booleancontainsAdvancedSearchTag(String query, String tag) (package private) static StringcreateExpressionDescription(String description, String expressionString) (package private) static voidevaluateTokensLevels(List<Token> initialTokens) Evaluates tokens levels(package private) static intfindNonNegativeMinimum(int a, int b) (package private) static intfindNonNegativeMinimum(int a, int b, int c) getBaseKeyWordsList(boolean parserKeyWordsOnly, boolean UDFExpression, boolean unicodeKeyWordsEnabled) getCopyOfInitialTokens(String expressionString, List<Token> initialTokens) Tokenizes expression string and returns tokens list, including: string, type, level.(package private) static List<FunctionParameter> getFunctionParameters(int pos, List<Token> tokensList) Returns list of the functions parameters.(package private) static String(package private) static StringgetHelp(String query, List<KeyWord> keyWordsList, boolean addHeader, boolean addCaption, String caption) (package private) static StringgetHelpAsCsv(List<KeyWord> keyWordsList, String quote, String delimiter, boolean addHeader, String query) (package private) static StringgetHelpAsHtmlTable(List<KeyWord> keyWordsList, boolean addHeader, boolean addCaption, boolean addFigure, String query, String caption, String cssClass) (package private) static StringgetHelpAsHtmlTable(List<KeyWord> keyWordsList, boolean addHeadline, String query) (package private) static StringgetHelpAsJson(List<KeyWord> keyWordsList, boolean addCaption, String query, String caption) (package private) static StringgetHelpAsMarkdownTable(List<KeyWord> keyWordsList, boolean addHeader, boolean addCaption, String query, String caption) (package private) static StringgetHelpAsMarkdownTable(List<KeyWord> keyWordsList, String query) getKeyWords(String query, List<KeyWord> keyWordsList) Returns list of keywords known to the parser(package private) static String[]getMissingUserDefinedArguments(List<Token> tokens) Returns missing user defined arguments names, i.e.(package private) static String[]getMissingUserDefinedFunctions(List<Token> tokens) Returns missing user defined functions names, i.e.(package private) static String[]getMissingUserDefinedUnits(List<Token> tokens) Returns missing user defined units names, i.e.(package private) static intgetNumeralSystemBaseFromBaseInd(String baseInd) (package private) static voidprivate static StringmakeCssClassDef(String cssClass) private static StringmakeJsonKeyValuePair(String key, String value) makeParserKeyWords(boolean parserKeyWordsOnly, boolean UDFExpression, boolean unicodeKeyWordsEnabled) private static voidmakeParserKeyWords(boolean parserKeyWordsOnly, boolean UDFExpression, boolean unicodeKeyWordsEnabled, List<KeyWord> keyWordsList) private static StringselectCaption(String query, String caption) (package private) static voidshowKeyWords(List<KeyWord> keyWordsList) (package private) static voidshowParsing(int lPos, int rPos, List<Token> tokensList) Shows parsing (verbose mode purposes).(package private) static voidshowTokens(List<Token> tokensList) (package private) static StringtokensListToString(List<Token> tokensList) (package private) static StringtokenToString(Token token)
-
Field Details
-
LANGUAGE_SPECIFIC_DESCRIPTIONS_SET
static final boolean LANGUAGE_SPECIFIC_DESCRIPTIONS_SET -
baseKeyWordsListParUdfUni111
-
baseKeyWordsListParUdfUni110
-
baseKeyWordsListParUdfUni101
-
baseKeyWordsListParUdfUni100
-
baseKeyWordsListParUdfUni011
-
baseKeyWordsListParUdfUni010
-
baseKeyWordsListParUdfUni001
-
baseKeyWordsListParUdfUni000
-
FUNCTION
- See Also:
-
ARGUMENT
- See Also:
-
UNITCONST
- See Also:
-
ERROR
- See Also:
-
KEY_ADVANCED_SEARCH_TAG
- See Also:
-
DESC_ADVANCED_SEARCH_TAG
- See Also:
-
SYN_ADVANCED_SEARCH_TAG
- See Also:
-
SINCE_ADVANCED_SEARCH_TAG
- See Also:
-
KEYID_ADVANCED_SEARCH_TAG
- See Also:
-
TYPEID_ADVANCED_SEARCH_TAG
- See Also:
-
TYPE_ADVANCED_SEARCH_TAG
- See Also:
-
-
Constructor Details
-
ExpressionUtils
ExpressionUtils()
-
-
Method Details
-
addUDFSpecificParserKeyWords
-
addArgumentsKeyWords
-
addFunctionsKeyWords
-
addConstantsKeyWords
-
addKeyWord
-
addKeyWordUnicode
-
addParserKeyWords
-
getBaseKeyWordsList
-
makeAllParserKeyWords
static void makeAllParserKeyWords() -
makeParserKeyWords
-
makeParserKeyWords
-
getFunctionParameters
Returns list of the functions parameters.- Parameters:
pos- the function positiontokensList- the tokens list- Returns:
- the list of function parameters
- See Also:
-
cleanMinusMinus
-
cleanExpressionString
-
createExpressionDescription
-
getCopyOfInitialTokens
-
getMissingUserDefinedArguments
-
getMissingUserDefinedUnits
-
getMissingUserDefinedFunctions
-
showKeyWords
-
getHelp
-
getHelp
-
getHelpAsCsv
-
buildHtmlTableRows
private static void buildHtmlTableRows(List<KeyWord> keyWordsList, boolean addHeader, StringBuilder stringBuilder) -
buildMarkdownTableRows
private static void buildMarkdownTableRows(List<KeyWord> keyWordsList, boolean addHeader, StringBuilder stringBuilder) -
makeJsonKeyValuePair
-
buildJsonRows
-
buildHelpCaption
-
selectCaption
-
makeCssClassDef
-
getHelpAsHtmlTable
-
getHelpAsHtmlTable
-
getHelpAsMarkdownTable
-
getHelpAsMarkdownTable
-
getHelpAsJson
-
buildHelpSearchLine
-
containsAdvancedSearchTag
-
checkIfAdvancedSearch
-
getKeyWords
Returns list of keywords known to the parser- Parameters:
query- Give any string to filter list of keywords against this string. User more precise syntax: str=tokenString, desc=tokenDescription, syn=TokenSyntax, sin=tokenSince, wid=wordId, tid=wordTypeId to narrow the result.- Returns:
- List of keywords known to the parser filter against query string.
- See Also:
-
showParsing
-
showTokens
-
tokenToString
-
tokensListToString
-
evaluateTokensLevels
-
getNumeralSystemBaseFromBaseInd
-
findNonNegativeMinimum
static int findNonNegativeMinimum(int a, int b) -
findNonNegativeMinimum
static int findNonNegativeMinimum(int a, int b, int c) -
cloneForThreadSafeArgumenstList
static List<Argument> cloneForThreadSafeArgumenstList(Expression relatedExpressionThatInitiatedClone, List<Argument> argumentsListToClone, CloneCache cloneCache) -
cloneForThreadSafeFunctionsList
static List<Function> cloneForThreadSafeFunctionsList(Expression relatedExpressionThatInitiatedClone, List<Function> functionsListToClone, CloneCache cloneCache) -
cloneForThreadSafeConstantsList
static List<Constant> cloneForThreadSafeConstantsList(Expression relatedExpressionThatInitiatedClone, List<Constant> constantsListToClone, CloneCache cloneCache)
-