|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omnaest.i18nbinder.grouping.FileGrouper
public class FileGrouper
This class supports the grouping of File instances by their file names.
The grouping is tried to be done to as many defined regular expression groups as possible. This implies the groups have the
same value. If the values are different only the first group is replaced.
#determineFileGroupList()| Field Summary | |
|---|---|
protected List<File> |
fileList
|
protected String |
GROUPING_REPLACEMENT_TOKEN_DEFAULT
|
protected Pattern |
groupingPattern
|
protected List<Integer> |
groupingPatternGroupingGroupIndexList
|
protected String |
groupingPatternReplacementToken
|
| Constructor Summary | |
|---|---|
FileGrouper()
|
|
| Method Summary | |
|---|---|
boolean |
addAllFiles(Collection<? extends File> fileCollection)
Adds all given File instances to the FileGrouper. |
boolean |
addFile(File e)
Adds the given File to the FileGrouper. |
void |
clearFiles()
Clears the Files from the FileGrouper. |
boolean |
containsFile(File file)
|
Map<String,FileGroup> |
determineFileGroupIdentifierToFileGroupMap()
Determines a Map with the file group identifier as key and the FileGroup instances as values. |
List<Integer> |
getGroupingPatternGroupingGroupIndexList()
|
String |
getGroupingPatternReplacementToken()
|
String |
getGroupingPatternString()
|
boolean |
remove(File file)
Removes the given File from the FileGrouper. |
boolean |
removeAll(Collection<File> fileCollection)
Removes all given File instances from the FileGrouper. |
void |
setGroupingPatternGroupingGroupIndexList(List<Integer> groupingPatternGroupingGroupIndexList)
|
void |
setGroupingPatternReplacementToken(String groupingPatternReplacementToken)
|
void |
setGroupingPatternString(String groupingPatternString)
|
int |
size()
Returns the number of files. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String GROUPING_REPLACEMENT_TOKEN_DEFAULT
protected List<File> fileList
protected Pattern groupingPattern
protected List<Integer> groupingPatternGroupingGroupIndexList
protected String groupingPatternReplacementToken
| Constructor Detail |
|---|
public FileGrouper()
| Method Detail |
|---|
public Map<String,FileGroup> determineFileGroupIdentifierToFileGroupMap()
Map with the file group identifier as key and the FileGroup instances as values. This grouping
is based on an investigation in the absolute file names. If they match the given grouping pattern the first group of the
pattern is replaced by an general token. If the resulting string from multiple files match now, they are grouped together.
setGroupingPatternString(String),
FileGrouppublic boolean addFile(File e)
File to the FileGrouper.
e -
public boolean addAllFiles(Collection<? extends File> fileCollection)
File instances to the FileGrouper.
fileCollection -
public void clearFiles()
Files from the FileGrouper.
public boolean containsFile(File file)
public boolean remove(File file)
File from the FileGrouper.
file -
public boolean removeAll(Collection<File> fileCollection)
File instances from the FileGrouper.
fileCollection -
public int size()
public String getGroupingPatternString()
public void setGroupingPatternString(String groupingPatternString)
throws Exception
Exceptionpublic String getGroupingPatternReplacementToken()
public void setGroupingPatternReplacementToken(String groupingPatternReplacementToken)
public List<Integer> getGroupingPatternGroupingGroupIndexList()
public void setGroupingPatternGroupingGroupIndexList(List<Integer> groupingPatternGroupingGroupIndexList)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||