Class Expression
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.predictioncheck.AbstractPredictionCheck
-
- adams.flow.transformer.predictioncheck.Expression
-
- All Implemented Interfaces:
adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.QuickInfoSupporter,adams.core.SizeOfHandler,Serializable
public class Expression extends AbstractPredictionCheck
Evaluates the specified boolean expression. The expression makes all numeric evaluation values available as symbols for the calculation.
Adds a new boolean evaluation with suffix .passed to the container with the result of the expression and one with the suffix .expression with the expanded expression, using the specified evaluation name.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING min-user-mode: Expert
-expression <adams.parser.BooleanExpressionText> (property: expression) The boolean expression to evaluate; all evaluations are available as symbols. default: true
-evaluation <java.lang.String> (property: evaluation) The name of the evaluation to store the result under. default:
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_Evaluationthe evaluation to check.protected adams.parser.BooleanExpressionTextm_Expressionthe expression to evaluate.static StringSUFFIX_EXPRESSIONthe suffix for the expression.static StringSUFFIX_PASSEDthe suffix for the expression.
-
Constructor Summary
Constructors Constructor Description Expression()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Stringcheck(EvaluationContainer cont)Hook method for checks.voiddefineOptions()Adds options to the internal list of options.EvaluationContainerdoCheckPrediction(EvaluationContainer cont)Performs the actual checks on the prediction.StringevaluationTipText()Returns the tip text for this property.StringexpressionTipText()Returns the tip text for this property.StringgetEvaluation()Returns the evaluation name to store the result under.adams.parser.BooleanExpressionTextgetExpression()Returns the boolean expression to evaluate.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.StringglobalInfo()Returns a string describing the object.voidsetEvaluation(String value)Sets the evaluation name to store the result under.voidsetExpression(adams.parser.BooleanExpressionText value)Sets the boolean expression to evaluate.-
Methods inherited from class adams.flow.transformer.predictioncheck.AbstractPredictionCheck
checkPrediction
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
SUFFIX_EXPRESSION
public static final String SUFFIX_EXPRESSION
the suffix for the expression.- See Also:
- Constant Field Values
-
SUFFIX_PASSED
public static final String SUFFIX_PASSED
the suffix for the expression.- See Also:
- Constant Field Values
-
m_Expression
protected adams.parser.BooleanExpressionText m_Expression
the expression to evaluate.
-
m_Evaluation
protected String m_Evaluation
the evaluation to check.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.core.option.AbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.core.option.AbstractOptionHandler
-
setExpression
public void setExpression(adams.parser.BooleanExpressionText value)
Sets the boolean expression to evaluate.- Parameters:
value- the expression
-
getExpression
public adams.parser.BooleanExpressionText getExpression()
Returns the boolean expression to evaluate.- Returns:
- the expression
-
expressionTipText
public String expressionTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setEvaluation
public void setEvaluation(String value)
Sets the evaluation name to store the result under.- Parameters:
value- the evaluation
-
getEvaluation
public String getEvaluation()
Returns the evaluation name to store the result under.- Returns:
- the evaluation
-
evaluationTipText
public String evaluationTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Overrides:
getQuickInfoin classAbstractPredictionCheck- Returns:
- null if no info available, otherwise short string
-
check
protected String check(EvaluationContainer cont)
Hook method for checks.- Overrides:
checkin classAbstractPredictionCheck- Parameters:
cont- the container to check- Returns:
- null if successful, otherwise error message
-
doCheckPrediction
public EvaluationContainer doCheckPrediction(EvaluationContainer cont)
Performs the actual checks on the prediction.- Specified by:
doCheckPredictionin classAbstractPredictionCheck- Parameters:
cont- the container to check- Returns:
- the updated container
-
-