Package adams.data.id
Class AbstractIDFilenameGenerator<T>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.id.AbstractIDGenerator<T>
-
- adams.data.id.AbstractIDFilenameGenerator<T>
-
- Type Parameters:
T
- the data type to accept
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<AbstractIDGenerator>
,SizeOfHandler
,Serializable
,Comparable
- Direct Known Subclasses:
SimpleIDGenerator
public abstract class AbstractIDFilenameGenerator<T> extends AbstractIDGenerator<T>
Abstract base class for ID string generators. Derived classes only have to override theassemble(Object)
method. Thereset()
method can be used to reset a scheme's internal state, e.g., after setting options, which invalidate the previously generated data.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_FilenameReplaceChar
the filename replacement character.protected boolean
m_MakeFilename
whether to make the ID filename compliant.-
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 AbstractIDFilenameGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.String
filenameReplaceCharTipText()
Returns the tip text for this property.String
getFilenameReplaceChar()
Returns replacement character for filenames.boolean
getMakeFilename()
Returns whether to make the ID filename compliant.String
makeFilenameTipText()
Returns the tip text for this property.protected String
postProcess(String id)
For post-processing the ID.void
setFilenameReplaceChar(String value)
Sets the replacement character for filenames.void
setMakeFilename(boolean value)
Sets whether to make the ID filename compliant.-
Methods inherited from class adams.data.id.AbstractIDGenerator
assemble, check, compareTo, equals, generate, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_MakeFilename
protected boolean m_MakeFilename
whether to make the ID filename compliant.
-
m_FilenameReplaceChar
protected String m_FilenameReplaceChar
the filename replacement character.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setMakeFilename
public void setMakeFilename(boolean value)
Sets whether to make the ID filename compliant.- Parameters:
value
- if true then all non-filename characters are removed
-
getMakeFilename
public boolean getMakeFilename()
Returns whether to make the ID filename compliant.- Returns:
- true if all non-filename characters are removed
-
makeFilenameTipText
public String makeFilenameTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFilenameReplaceChar
public void setFilenameReplaceChar(String value)
Sets the replacement character for filenames.- Parameters:
value
- the character or empty string
-
getFilenameReplaceChar
public String getFilenameReplaceChar()
Returns replacement character for filenames.- Returns:
- the character or empty string
-
filenameReplaceCharTipText
public String filenameReplaceCharTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
postProcess
protected String postProcess(String id)
For post-processing the ID.
The default implementation can make the ID filename-compliant.- Overrides:
postProcess
in classAbstractIDGenerator<T>
- Parameters:
id
- the ID to post-process- Returns:
- the post-processed id
- See Also:
m_MakeFilename
-
-