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 Stringm_Groupthe group to extract.protected booleanm_OnlyNamewhether to use only the name, not the path.protected Stringm_RegExpthe regular expression.protected booleanm_RemoveExtensionwhether 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 StringextractGroup(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:
extractGroupin interfaceGrouping.GroupExtractor<String>- Parameters:
item- the item to extract the group from- Returns:
- the extracted group
-
-