public class FormulaParser
extends java.lang.Object
( 4 + 6 ) * yield
grain mois / 2
.de.fho.jump.pirol.utilities.FeatureCollectionTools#applyFormulaToFeatureCollection(FeatureCollection, AttributeInfo, FormulaValue, boolean)
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
KEY_ACOS |
static java.lang.String |
KEY_ASIN |
static java.lang.String |
KEY_ATAN |
static java.lang.String |
KEY_COS |
static java.lang.String |
KEY_EXP |
static java.lang.String |
KEY_LOG |
static java.lang.String |
KEY_LOG10 |
static java.lang.String |
KEY_PI |
static java.lang.String |
KEY_POW |
static java.lang.String |
KEY_SIN |
static java.lang.String |
KEY_SQRT |
static java.lang.String |
KEY_TAN |
static java.lang.String |
KEY_TODEG |
static java.lang.String |
KEY_TORAD |
protected static PersonalLogger |
logger |
Constructor and Description |
---|
FormulaParser() |
Modifier and Type | Method and Description |
---|---|
protected static int |
findFirstAddSubOperatorOutsideABracket(java.lang.String formula,
int fromIndex) |
protected static int |
findFirstMultiDivOperatorOutsideABracket(java.lang.String formula,
int fromIndex) |
protected static int |
findFirstOccuranceOutsideABracket(java.lang.String toBeFound,
java.lang.String formula,
int fromIndex) |
protected static java.lang.String |
getFirstCompleteBracketString(java.lang.String formula,
int fromIndex) |
static FormulaValue |
getValue(java.lang.String formula,
FeatureSchema featSchema)
Recursively parses a given (sub-) formula into a FormulaValue, which can be an operation with
sub-FormularValues or a value.
|
protected static boolean |
isBracket(java.lang.String brack) |
protected static boolean |
isOperator(java.lang.String op) |
protected static java.lang.String |
kickOutSurroundingBracket(java.lang.String formula)
deletes a bracket that surrounds the whole formula from the formula.
|
protected static java.lang.String[] |
splitToFirstLevelOperation(java.lang.String formula) |
protected static PersonalLogger logger
public static final java.lang.String KEY_SQRT
public static final java.lang.String KEY_POW
public static final java.lang.String KEY_PI
public static final java.lang.String KEY_LOG
public static final java.lang.String KEY_SIN
public static final java.lang.String KEY_COS
public static final java.lang.String KEY_TAN
public static final java.lang.String KEY_EXP
public static final java.lang.String KEY_ASIN
public static final java.lang.String KEY_ACOS
public static final java.lang.String KEY_ATAN
public static final java.lang.String KEY_LOG10
public static final java.lang.String KEY_TODEG
public static final java.lang.String KEY_TORAD
public static FormulaValue getValue(java.lang.String formula, FeatureSchema featSchema)
formula
- featSchema
- The feature schema to check attribute names, if neccessaryprotected static boolean isOperator(java.lang.String op)
protected static boolean isBracket(java.lang.String brack)
protected static int findFirstOccuranceOutsideABracket(java.lang.String toBeFound, java.lang.String formula, int fromIndex)
protected static int findFirstAddSubOperatorOutsideABracket(java.lang.String formula, int fromIndex)
protected static int findFirstMultiDivOperatorOutsideABracket(java.lang.String formula, int fromIndex)
protected static java.lang.String[] splitToFirstLevelOperation(java.lang.String formula)
protected static java.lang.String getFirstCompleteBracketString(java.lang.String formula, int fromIndex)
protected static java.lang.String kickOutSurroundingBracket(java.lang.String formula)
formula
- formula String