dutils.digger.comparators
Class DefaultComparator

java.lang.Object
  |
  +--dutils.digger.comparators.Comparator
        |
        +--dutils.digger.comparators.DefaultComparator

public class DefaultComparator
extends Comparator

A default Comparator that checks if the searched file or ZipEntry String representation matches the search. This Comparator uses the full path for comparison.

Version:
1.0
Author:
Daniel Or

Field Summary
 
Fields inherited from class dutils.digger.comparators.Comparator
exclude, toFind, transformsOnSearchedEntry
 
Constructor Summary
DefaultComparator(java.lang.String[] toFind, java.lang.String[] exclude)
          Creates a new DefaultComparator object.
DefaultComparator(java.lang.String[] toFind, java.lang.String[] exclude, StringTransformation[] transOnSearchedEntry)
          Creates a new DefaultComparator.
 
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.
 
Methods inherited from class dutils.digger.comparators.Comparator
compare, compareStrImpl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultComparator

public DefaultComparator(java.lang.String[] toFind,
                         java.lang.String[] exclude,
                         StringTransformation[] transOnSearchedEntry)
Creates a new DefaultComparator.

See Also:
dutils.digger.Comparator#dutils.digger.Comparator(String[], String[], StringTransformation[])

DefaultComparator

public DefaultComparator(java.lang.String[] toFind,
                         java.lang.String[] exclude)
Creates a new DefaultComparator object.

See Also:
dutils.digger.Comparator#dutils.digger.Comparator(String[], String[])
Method Detail

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.