Package adams.flow.condition.bool
Class FilesMatch
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<BooleanCondition>
,SizeOfHandler
,Stoppable
,BooleanCondition
,Serializable
public class FilesMatch extends AbstractBooleanCondition
Evaluates to 'true' if at least one file matches the regular expression in the specified directory.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-directory <adams.core.io.PlaceholderDirectory> (property: directory) The directory to search. default: ${CWD}
-regexp <adams.core.base.BaseRegExp> (property: regExp) The regular expression that the files must match. default: .*
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected PlaceholderDirectory
m_Directory
the directory to search.protected BaseRegExp
m_RegExp
the expression the files must match.-
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 FilesMatch()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class[]
accepts()
Returns the class that the consumer accepts.void
defineOptions()
Adds options to the internal list of options.String
directoryTipText()
Returns the tip text for this property.protected boolean
doEvaluate(Actor owner, Token token)
Performs the actual evaluation.PlaceholderDirectory
getDirectory()
Returns the directory to search.String
getQuickInfo()
Returns the quick info string to be displayed in the flow editor.BaseRegExp
getRegExp()
Returns the regular expression that the files must match.String
globalInfo()
Returns a string describing the object.String
regExpTipText()
Returns the tip text for this property.void
setDirectory(PlaceholderDirectory value)
Sets the directory to search.void
setRegExp(BaseRegExp value)
Sets the regular expression that the files must match.String
setUp(Actor owner)
Configures the condition.-
Methods inherited from class adams.flow.condition.bool.AbstractBooleanCondition
evaluate, preEvaluate, shallowCopy, shallowCopy, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Directory
protected PlaceholderDirectory m_Directory
the directory to search.
-
m_RegExp
protected BaseRegExp m_RegExp
the expression the files must match.
-
-
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 classAbstractOptionHandler
-
setDirectory
public void setDirectory(PlaceholderDirectory value)
Sets the directory to search.- Parameters:
value
- the directory
-
getDirectory
public PlaceholderDirectory getDirectory()
Returns the directory to search.- Returns:
- the directory
-
directoryTipText
public String directoryTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRegExp
public void setRegExp(BaseRegExp value)
Sets the regular expression that the files must match.- Parameters:
value
- the expression
-
getRegExp
public BaseRegExp getRegExp()
Returns the regular expression that the files must match.- Returns:
- the expression
-
regExpTipText
public String regExpTipText()
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 the quick info string to be displayed in the flow editor.- Specified by:
getQuickInfo
in interfaceBooleanCondition
- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Specified by:
getQuickInfo
in classAbstractBooleanCondition
- Returns:
- the info or null if no info to be displayed
-
accepts
public Class[] accepts()
Returns the class that the consumer accepts.- Specified by:
accepts
in interfaceBooleanCondition
- Specified by:
accepts
in classAbstractBooleanCondition
- Returns:
- Unknown
-
setUp
public String setUp(Actor owner)
Configures the condition.- Specified by:
setUp
in interfaceBooleanCondition
- Overrides:
setUp
in classAbstractBooleanCondition
- Parameters:
owner
- the actor this condition belongs to- Returns:
- null if everything is fine, otherwise error message
-
doEvaluate
protected boolean doEvaluate(Actor owner, Token token)
Performs the actual evaluation.- Specified by:
doEvaluate
in classAbstractBooleanCondition
- Parameters:
owner
- the owning actortoken
- the current token passing through- Returns:
- the result of the evaluation
-
-