Package adams.data.binning
Class BinnableFiles.FileGroupExtractor
- java.lang.Object
-
- adams.data.binning.BinnableFiles.FileGroupExtractor
-
- All Implemented Interfaces:
Grouping.GroupExtractor<String>
,Serializable
- Enclosing class:
- BinnableFiles
public static class BinnableFiles.FileGroupExtractor extends Object implements Grouping.GroupExtractor<String>, Serializable
Allows to extract groups either from full name or from just filename.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_Group
the group to extract.protected boolean
m_OnlyName
whether to use only the name, not the path.protected String
m_RegExp
the regular expression.protected boolean
m_RemoveExtension
whether to remove the extension.
-
Constructor Summary
Constructors Constructor Description FileGroupExtractor(boolean onlyName, boolean removeExtension, String regExp, String group)
Initializes the extractor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
extractGroup(Binnable<String> item)
Extracts the group from the binnable object.
-
-
-
Constructor Detail
-
FileGroupExtractor
public FileGroupExtractor(boolean onlyName, boolean removeExtension, String regExp, String group)
Initializes the extractor.- Parameters:
onlyName
- whether to only consider the name, excluding the pathremoveExtension
- whether to remove the extensionregExp
- the regular expression to apply to the stringsgroup
- the regexp group to extract as group
-
-
Method Detail
-
extractGroup
public String extractGroup(Binnable<String> item)
Extracts the group from the binnable object.- Specified by:
extractGroup
in interfaceGrouping.GroupExtractor<String>
- Parameters:
item
- the item to extract the group from- Returns:
- the extracted group
-
-