dutils.digger.comparators
Class FieldComparator
java.lang.Object
|
+--dutils.digger.comparators.Comparator
|
+--dutils.digger.comparators.FieldComparator
- public class FieldComparator
- extends Comparator
In case that a searched entry is a class file, this Comparator
compares fields names to check if they match the search criteria.
- Version:
- 1.0
- Author:
- Daniel Or
Constructor Summary |
FieldComparator(java.lang.String[] toFind,
java.lang.String[] exclude,
boolean caseSensitive)
Creates a new FieldComparator object. |
Method Summary |
boolean |
compare(java.io.File f)
Checks if a given file matches search criteria. |
boolean |
compare(java.io.File f,
java.util.zip.ZipFile zFile,
java.util.zip.ZipEntry zEntry)
Checks if a given ZipEntry matches search criteria. |
java.lang.String |
getLastFound()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FieldComparator
public FieldComparator(java.lang.String[] toFind,
java.lang.String[] exclude,
boolean caseSensitive)
- Creates a new FieldComparator object.
- Parameters:
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.caseSensitive
- a boolean that notes whether the search is case sensitive or not.
getLastFound
public java.lang.String getLastFound()
- Returns:
- String
compare
public boolean compare(java.io.File f,
java.util.zip.ZipFile zFile,
java.util.zip.ZipEntry zEntry)
- Description copied from class:
Comparator
- Checks if a given
ZipEntry
matches search criteria.
All parameters are required in order to look into the given ZipEntry
.
- Specified by:
compare
in class Comparator
- Parameters:
f
- the actual zip File
.zFile
- a ZipFile
object.zEntry
- a ZipEntry
object.
- Returns:
- true if zEntry metches the search criteria.
compare
public boolean compare(java.io.File f)
- Description copied from class:
Comparator
- Checks if a given file matches search criteria.
- Specified by:
compare
in class Comparator
- Parameters:
f
- a File
tom check.
- Returns:
- true if f metches the search criteria.