Package adams.data.outlier
Class Groovy
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,FileBasedScripting
,FileBasedScriptingWithOptions
,ShallowCopySupporter
,SizeOfHandler
,OutlierDetector
,Serializable
,Comparable
public class Groovy extends AbstractScriptedOutlierDetector
An outlier detector that uses a Groovy script for processing the data.
Valid options are:
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-script <adams.core.io.PlaceholderFile> (property: scriptFile) The script file to load and execute. default: ${CWD}
-options <java.lang.String> (property: scriptOptions) The options for the Groovy script; must consist of 'key=value' pairs separated by blanks; the value of 'key' can be accessed via the 'getAdditionalOptions ().getXYZ("key")' method in the Groovy actor. default:
-inline-script <adams.core.scripting.GroovyScript> (property: inlineScript) The inline script, if not using an external script file. default:
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.data.outlier.AbstractOutlierDetector
AbstractOutlierDetector.DetectorJob<T extends DataContainer>
-
-
Field Summary
Fields Modifier and Type Field Description protected GroovyScript
m_InlineScript
the inline script.protected AbstractOutlierDetector
m_OutlierDetectorObject
the loaded script object.-
Fields inherited from class adams.data.outlier.AbstractScriptedOutlierDetector
m_ScriptFile, m_ScriptObject, m_ScriptOptions
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description Groovy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkData(DataContainer data)
The default implementation only checks whether there is any data set.protected String
checkScriptObject()
Checks the script object.void
defineOptions()
Adds options to the internal list of options.void
destroy()
Frees up memory in a "destructive" non-reversible way.protected GroovyScript
getDefaultInlineScript()
Returns the default inline script.GroovyScript
getInlineScript()
Gets the inline script to use instead of the external script file.String
globalInfo()
Returns a string describing the object.String
inlineScriptTipText()
Returns the tip text for this property.protected String
loadScriptObject()
Loads the scripts object and sets its options.protected List<String>
processData(DataContainer data)
Performs the actual detection.String
scriptOptionsTipText()
Returns the tip text for this property.void
setInlineScript(GroovyScript value)
Sets the inline script to use instead of the external script file.-
Methods inherited from class adams.data.outlier.AbstractScriptedOutlierDetector
getScriptFile, getScriptOptions, initScriptObject, reset, scriptFileTipText, setScriptFile, setScriptOptions
-
Methods inherited from class adams.data.outlier.AbstractOutlierDetector
cleanUp, compareTo, detect, equals, forCommandLine, forName, getOutlierDetectors, getQuickInfo, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_OutlierDetectorObject
protected transient AbstractOutlierDetector m_OutlierDetectorObject
the loaded script object.
-
m_InlineScript
protected GroovyScript m_InlineScript
the inline script.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractScriptedOutlierDetector
-
scriptOptionsTipText
public String scriptOptionsTipText()
Returns the tip text for this property.- Specified by:
scriptOptionsTipText
in interfaceFileBasedScriptingWithOptions
- Overrides:
scriptOptionsTipText
in classAbstractScriptedOutlierDetector
- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getDefaultInlineScript
protected GroovyScript getDefaultInlineScript()
Returns the default inline script.- Returns:
- the default script
-
setInlineScript
public void setInlineScript(GroovyScript value)
Sets the inline script to use instead of the external script file.- Parameters:
value
- the inline script
-
getInlineScript
public GroovyScript getInlineScript()
Gets the inline script to use instead of the external script file.- Returns:
- the inline script
-
inlineScriptTipText
public String inlineScriptTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
loadScriptObject
protected String loadScriptObject()
Loads the scripts object and sets its options.- Specified by:
loadScriptObject
in classAbstractScriptedOutlierDetector
- Returns:
- null if OK, otherwise the error message
-
checkScriptObject
protected String checkScriptObject()
Checks the script object.- Specified by:
checkScriptObject
in classAbstractScriptedOutlierDetector
- Returns:
- null if OK, otherwise the error message
-
checkData
protected void checkData(DataContainer data)
The default implementation only checks whether there is any data set.- Overrides:
checkData
in classAbstractScriptedOutlierDetector
- Parameters:
data
- the data to filter
-
processData
protected List<String> processData(DataContainer data)
Performs the actual detection.- Specified by:
processData
in classAbstractOutlierDetector
- Parameters:
data
- the data to process- Returns:
- the detections
-
destroy
public void destroy()
Frees up memory in a "destructive" non-reversible way.- Specified by:
destroy
in interfaceDestroyable
- Overrides:
destroy
in classAbstractScriptedOutlierDetector
- See Also:
AbstractOptionHandler.cleanUpOptions()
-
-