Package hec.hecmath.computation
Class TextExpression
java.lang.Object
hec.hecmath.computation.TextExpression
- All Implemented Interfaces:
Constants,Evaluable,Updatable,UpdatableListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface hec.hecmath.computation.Constants
Constants.LogicTestOperator, Constants.MathOperator, Constants.Notation, Constants.Precedence, Constants.QualityOperator, Constants.QualityTestOperator, Constants.TextOperator, Constants.TextTestOperator, Constants.ValueTestOperator -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected static booleanprotected booleanprotected static booleanprotected Evaluableprotected Constants.Notationprotected Stringprotected Stringprotected booleanprotected booleanprotected static booleanprotected Set<UpdatableListener>protected Objectprotected Objectprotected VariableSet -
Constructor Summary
ConstructorsConstructorDescriptionTextExpression(String expr) TextExpression(String expr, VariableSet variables) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuildExpression(List<String> tokens) voiddoubleevaluate()booleanstatic booleanbooleanstatic booleanbooleanstatic booleanprotected StringinfixToPostfix(String infix) infixToPostfix(List<String> infix) protected TextOperationmakeOperationFromPostfix(Stack<String> stack) protected TextOperationmakeOperationFromPrefix(Queue<String> queue) voidparseTextExpression(String expr) parseTextExpression(String expr, Constants.Notation notation) voidvoidregisterListener(UpdatableListener listener) voidsetAllowDenormal(boolean setting) static voidsetAllowDenormalByDefault(boolean setting) voidsetExceptionOnUndefined(boolean setting) static voidsetExceptionOnUndefinedByDefault(boolean setting) protected voidsetTextExpression(String expr) voidsetTolerateUndefined(boolean setting) static voidsetTolerateUndefinedByDefault(boolean setting) protected StringsexpToPrefix(String sexp) sexpToPrefix(List<String> sexp) toNotation(Constants.Notation notation) toString()voidvoidvoidunregisterListener(UpdatableListener listener)
-
Field Details
-
tolerateUndefinedByDefault
protected static boolean tolerateUndefinedByDefault -
exceptionOnUndefinedByDefault
protected static boolean exceptionOnUndefinedByDefault -
allowDenormalByDefault
protected static boolean allowDenormalByDefault -
tolerateUndefined
protected boolean tolerateUndefined -
exceptionOnUndefined
protected boolean exceptionOnUndefined -
allowDenormal
protected boolean allowDenormal -
inputText
-
inputNotation
-
expression
-
variables
-
updateListeners
-
updateListenersLock
-
updateSources
-
updateSourcesLock
-
stale
protected boolean stale -
result
-
-
Constructor Details
-
TextExpression
public TextExpression() -
TextExpression
- Throws:
ComputationException
-
TextExpression
- Throws:
ComputationException
-
-
Method Details
-
getTolerateUndefinedByDefault
public static boolean getTolerateUndefinedByDefault() -
setTolerateUndefinedByDefault
public static void setTolerateUndefinedByDefault(boolean setting) -
getExceptionOnUndefinedByDefault
public static boolean getExceptionOnUndefinedByDefault() -
setExceptionOnUndefinedByDefault
public static void setExceptionOnUndefinedByDefault(boolean setting) -
getAllowDenormalByDefault
public static boolean getAllowDenormalByDefault() -
setAllowDenormalByDefault
public static void setAllowDenormalByDefault(boolean setting) -
registerListener
- Specified by:
registerListenerin interfaceUpdatable
-
unregisterListener
- Specified by:
unregisterListenerin interfaceUpdatable
-
notifyListeners
public void notifyListeners()- Specified by:
notifyListenersin interfaceUpdatable
-
dataUpdated
- Specified by:
dataUpdatedin interfaceUpdatableListener
-
registerAsListener
- Specified by:
registerAsListenerin interfaceUpdatableListener
-
unregisterAsListener
- Specified by:
unregisterAsListenerin interfaceUpdatableListener
-
unregisterAsListener
public void unregisterAsListener()- Specified by:
unregisterAsListenerin interfaceUpdatableListener
-
evaluate
- Specified by:
evaluatein interfaceEvaluable- Throws:
ComputationException
-
evaluateToString
- Specified by:
evaluateToStringin interfaceEvaluable- Throws:
ComputationException
-
sexpToPrefix
- Throws:
ComputationException
-
sexpToPrefix
- Throws:
ComputationException
-
infixToPostfix
- Throws:
ComputationException
-
infixToPostfix
- Throws:
ComputationException
-
setTextExpression
- Throws:
ComputationException
-
parseTextExpression
- Throws:
ComputationException
-
parseTextExpression
protected List<String> parseTextExpression(String expr, Constants.Notation notation) throws ComputationException - Throws:
ComputationException
-
makeOperationFromPostfix
- Throws:
ComputationException
-
makeOperationFromPrefix
- Throws:
ComputationException
-
buildExpression
- Throws:
ComputationException
-
toNotation
- Specified by:
toNotationin interfaceEvaluable- Throws:
ComputationException
-
getTolerateUndefined
public boolean getTolerateUndefined()- Specified by:
getTolerateUndefinedin interfaceEvaluable
-
setTolerateUndefined
public void setTolerateUndefined(boolean setting) - Specified by:
setTolerateUndefinedin interfaceEvaluable
-
getExceptionOnUndefined
public boolean getExceptionOnUndefined()- Specified by:
getExceptionOnUndefinedin interfaceEvaluable
-
setExceptionOnUndefined
public void setExceptionOnUndefined(boolean setting) - Specified by:
setExceptionOnUndefinedin interfaceEvaluable
-
getAllowDenormal
public boolean getAllowDenormal()- Specified by:
getAllowDenormalin interfaceEvaluable
-
setAllowDenormal
public void setAllowDenormal(boolean setting) - Specified by:
setAllowDenormalin interfaceEvaluable
-
toString
-