|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--dutils.digger.comparators.Comparator
Comparator
s hold search data and know to tell if a given File
or ZipEntry
match the search criteria.
Field Summary | |
protected java.lang.String[] |
exclude
|
protected java.lang.String[] |
toFind
|
protected StringTransformation[] |
transformsOnSearchedEntry
|
Constructor Summary | |
Comparator(java.lang.String[] toFind,
java.lang.String[] exclude)
Creates a new Comparator object. |
|
Comparator(java.lang.String[] toFind,
java.lang.String[] exclude,
StringTransformation[] transOnSearchedEntry)
Creates a new Comparator object. |
Method Summary | |
abstract boolean |
compare(java.io.File f)
Checks if a given file matches search criteria. |
abstract boolean |
compare(java.io.File f,
java.util.zip.ZipFile zFile,
java.util.zip.ZipEntry zEntry)
Checks if a given ZipEntry matches search criteria. |
protected boolean |
compare(java.lang.String str)
This method is called by the other compare() methods for String
comparisons. |
protected boolean |
compareStrImpl(java.lang.String s)
Compares a given String to check if it matches the search criteria. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String[] toFind
protected java.lang.String[] exclude
protected StringTransformation[] transformsOnSearchedEntry
Constructor Detail |
public Comparator(java.lang.String[] toFind, java.lang.String[] exclude)
toFind
- a String[]
with all the strings that must be in a
matching entry.exclude
- a String[]
with all the strings that must NOT
be in a matching entry.public Comparator(java.lang.String[] toFind, java.lang.String[] exclude, StringTransformation[] transOnSearchedEntry)
toFind
- a String[]
with all the strings that must be in a
matching entry.exclude
- a String[]
with all the strings that must NOT
be in a matching entry.transOnSearchedEntry
- a StringTransformation[]
containing all
transformations that are to be applied on searched entries.Method Detail |
protected boolean compare(java.lang.String str)
String
comparisons.
The method applies the StringTransformation[]
on searched entries and
then calls compareStrImpl().
protected boolean compareStrImpl(java.lang.String s)
String
to check if it matches the search criteria.
s
- a String
to check.
public abstract boolean compare(java.io.File f)
f
- a File
tom check.
public abstract boolean compare(java.io.File f, java.util.zip.ZipFile zFile, java.util.zip.ZipEntry zEntry)
ZipEntry
matches search criteria.
All parameters are required in order to look into the given ZipEntry
.
f
- the actual zip File
.zFile
- a ZipFile
object.zEntry
- a ZipEntry
object.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |