| java.lang.Object de.fho.jump.pirol.utilities.FormulaParsing.FormulaParser
FormulaParser | public class FormulaParser (Code) | | This class is a utility to parse formulas, that describe how an additional attribute value is to be calculated on a by feature basis.
Formulas thereby can contain constant values as well as attribute values, that need to be extracted for each feature.
Formulas are exspected to be space-separated: Each attribute name, constant value, bracket or operator has to be surrounded by empty spaces.
A valid formulas (for a FeatureSchema that has the attributes "yield" and "grain mois") would look like this:
( 4 + 6 ) * yield or
grain mois / 2 .
author: Ole Rahn author:
author: FH Osnabrück - University of Applied Sciences Osnabrück, author: Project: PIROL (2005), author: Subproject: Daten- und Wissensmanagement version: $Rev: 856 $ See Also: de.fhOsnabrueck.jump.pirol.utilities.FeatureCollectionTools.applyFormulaToFeatureCollection(FeatureCollectionAttributeInfoFormulaValueboolean) |
findFirstAddSubOperatorOutsideABracket | protected static int findFirstAddSubOperatorOutsideABracket(String formula, int fromIndex)(Code) | | |
findFirstMultiDivOperatorOutsideABracket | protected static int findFirstMultiDivOperatorOutsideABracket(String formula, int fromIndex)(Code) | | |
findFirstOccuranceOutsideABracket | protected static int findFirstOccuranceOutsideABracket(String toBeFound, String formula, int fromIndex)(Code) | | |
getFirstCompleteBracketString | protected static String getFirstCompleteBracketString(String formula, int fromIndex)(Code) | | |
getValue | public static FormulaValue getValue(String formula, FeatureSchema featSchema)(Code) | | Recursively parses a given (sub-) formula into a FormulaValue, which can be an operation with
sub-FormularValues or a value.
Parameters: formula - Parameters: featSchema - The feature schema to check attribute names, if neccessary the given formula parsed into a FormulaValue or null if the given String did not contain formula information |
isBracket | protected static boolean isBracket(String brack)(Code) | | |
isOperator | protected static boolean isOperator(String op)(Code) | | |
kickOutSurroundingBracket | protected static String kickOutSurroundingBracket(String formula)(Code) | | deletes a bracket that surrounds the whole formula from the formula.
Parameters: formula - formula String formula String without surrounding bracket |
splitToFirstLevelOperation | protected static String[] splitToFirstLevelOperation(String formula)(Code) | | |
|
|