Package adams.data.id
Class SimpleIDGenerator
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<AbstractIDGenerator>
,SizeOfHandler
,Serializable
,Comparable
public class SimpleIDGenerator extends AbstractIDFilenameGenerator<Object>
A simple ID generator that can make use of data provided by classes implementing IDHandler and DatabaseIDHandler.
Valid options are:
-D (property: debug) If set to true, scheme may output additional info to the console.
-filename (property: makeFilename) If set to true, all characters that cannot appear in a filename are replaced with underscores '_'.
-filename-replace <java.lang.String> (property: filenameReplaceChar) The character for replacing invalid characters in IDs that are used for filenames; use empty string for removing the invalid characters. default:
-format <java.lang.String> (property: format) The format for the ID ({ID} = ID of IDHandler, {DBID} = database ID of DatabaseIDHandler ). default: {DBID}-{ID}
- 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_Format
the format of the ID to generate.static String
MISSING
the missing string, if the object doesn't implement a certain interface.-
Fields inherited from class adams.data.id.AbstractIDFilenameGenerator
m_FilenameReplaceChar, m_MakeFilename
-
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 SimpleIDGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
assemble(Object o)
Generates the actual ID.void
defineOptions()
Adds options to the internal list of options.String
formatTipText()
Returns the tip text for this property.String
getFormat()
Returns the currently set format for the ID.String
globalInfo()
Returns a string describing the object.void
setFormat(String value)
Sets the format for the ID.-
Methods inherited from class adams.data.id.AbstractIDFilenameGenerator
filenameReplaceCharTipText, getFilenameReplaceChar, getMakeFilename, makeFilenameTipText, postProcess, setFilenameReplaceChar, setMakeFilename
-
Methods inherited from class adams.data.id.AbstractIDGenerator
check, compareTo, equals, generate, shallowCopy, shallowCopy
-
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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
MISSING
public static final String MISSING
the missing string, if the object doesn't implement a certain interface.- See Also:
- Constant Field Values
-
m_Format
protected String m_Format
the format of the ID to generate.
-
-
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 classAbstractIDFilenameGenerator<Object>
-
setFormat
public void setFormat(String value)
Sets the format for the ID.- Parameters:
value
- the format
-
getFormat
public String getFormat()
Returns the currently set format for the ID.- Returns:
- the format
-
formatTipText
public String formatTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
assemble
protected String assemble(Object o)
Generates the actual ID.- Specified by:
assemble
in classAbstractIDGenerator<Object>
- Parameters:
o
- the object to generate the ID for- Returns:
- the generated ID
-
-