Package adams.core.io.filesearch
Class AbstractFileSearchHandler
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.core.io.filesearch.AbstractFileSearchHandler
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,FileSearchHandler
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<FileSearchHandler>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,Serializable
- Direct Known Subclasses:
AbstractFileSearchHandlerWithEncoding
,AbstractMetaFileSearchHandler
public abstract class AbstractFileSearchHandler extends AbstractOptionHandler implements FileSearchHandler, ShallowCopySupporter<FileSearchHandler>
Ancestor for search handlers.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static Logger
LOGGER
for logging in static context.protected static List<AbstractFileSearchHandler>
m_Handlers
the available handlers.protected boolean
m_Stopped
whether the search was stopped.-
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 AbstractFileSearchHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FileSearchHandler
getHandlerForFile(String file)
Returns the best-suited handler for the file.boolean
isStopped()
Whether the execution has been stopped.FileSearchHandler
shallowCopy()
Returns a shallow copy of itself.FileSearchHandler
shallowCopy(boolean expand)
Returns a shallow copy of itself.void
stopExecution()
Stops the execution.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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.io.filesearch.FileSearchHandler
handles, searchFile
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Handlers
protected static List<AbstractFileSearchHandler> m_Handlers
the available handlers.
-
LOGGER
protected static Logger LOGGER
for logging in static context.
-
m_Stopped
protected boolean m_Stopped
whether the search was stopped.
-
-
Method Detail
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecution
in interfaceStoppable
-
isStopped
public boolean isStopped()
Whether the execution has been stopped.- Specified by:
isStopped
in interfaceStoppableWithFeedback
- Returns:
- true if stopped
-
shallowCopy
public FileSearchHandler shallowCopy()
Returns a shallow copy of itself.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<FileSearchHandler>
- Returns:
- the shallow copy
-
shallowCopy
public FileSearchHandler shallowCopy(boolean expand)
Returns a shallow copy of itself.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<FileSearchHandler>
- Parameters:
expand
- whether to expand variables to their current values- Returns:
- the shallow copy
-
getHandlerForFile
public static FileSearchHandler getHandlerForFile(String file)
Returns the best-suited handler for the file.TextFileSearchHandler
is used as backup.- Parameters:
file
- the file to get a handler for- Returns:
- the handler, null if none available
-
-