Class RegExp
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.input.sampleidextraction.AbstractSampleIDExtraction
-
- adams.data.io.input.sampleidextraction.RegExp
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.SizeOfHandler
,SampleIDExtraction
,Serializable
public class RegExp extends AbstractSampleIDExtraction
Uses the specified group from a regular expression as sample ID.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-regexp <adams.core.base.BaseRegExp> (property: regExp) The regular expression for extracting the sample ID from the file name ( w/o path). default: (.*)\\\\.txt
-group <int> (property: group) The regular expression group that contains the sample ID. default: 1 minimum: 1
- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RegExp()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected String
doExtract(File file, Spectrum spec)
Performs the actual extraction.int
getGroup()
Returns the regular expression group that contains the sample ID from the file name (w/o path).adams.core.base.BaseRegExp
getRegExp()
Returns the regular expression in use to extract the sample ID from the file name (w/o path).String
globalInfo()
Returns a string describing the object.String
groupTipText()
Returns the tip text for this property.String
regExpTipText()
Returns the tip text for this property.void
setGroup(int value)
Sets the regular expression group that contains the sample ID from the file name (w/o path).void
setRegExp(adams.core.base.BaseRegExp value)
Sets the regular expression to use for extracting the sample ID from the file name (w/o path).-
Methods inherited from class adams.data.io.input.sampleidextraction.AbstractSampleIDExtraction
check, extract
-
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
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
- 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 interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
setRegExp
public void setRegExp(adams.core.base.BaseRegExp value)
Sets the regular expression to use for extracting the sample ID from the file name (w/o path).- Parameters:
value
- the expression
-
getRegExp
public adams.core.base.BaseRegExp getRegExp()
Returns the regular expression in use to extract the sample ID from the file name (w/o path).- 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.
-
setGroup
public void setGroup(int value)
Sets the regular expression group that contains the sample ID from the file name (w/o path).- Parameters:
value
- the group
-
getGroup
public int getGroup()
Returns the regular expression group that contains the sample ID from the file name (w/o path).- Returns:
- the group
-
groupTipText
public String groupTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
doExtract
protected String doExtract(File file, Spectrum spec)
Performs the actual extraction.- Specified by:
doExtract
in classAbstractSampleIDExtraction
- Parameters:
file
- the current filespec
- the current spectrum- Returns:
- the extracted sample ID
-
-