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 voiddefineOptions()Adds options to the internal list of options.protected StringdoExtract(File file, Spectrum spec)Performs the actual extraction.intgetGroup()Returns the regular expression group that contains the sample ID from the file name (w/o path).adams.core.base.BaseRegExpgetRegExp()Returns the regular expression in use to extract the sample ID from the file name (w/o path).StringglobalInfo()Returns a string describing the object.StringgroupTipText()Returns the tip text for this property.StringregExpTipText()Returns the tip text for this property.voidsetGroup(int value)Sets the regular expression group that contains the sample ID from the file name (w/o path).voidsetRegExp(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:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin 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:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin 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:
doExtractin classAbstractSampleIDExtraction- Parameters:
file- the current filespec- the current spectrum- Returns:
- the extracted sample ID
-
-