dutils.digger.comparators
Class MethodComparator

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

public class MethodComparator
extends Comparator

In case that a searched entry is a class file, this Comparator compares method names to check if they match the search criteria.

Version:
1.0
Author:
Daniel Or

Field Summary
 
Fields inherited from class dutils.digger.comparators.Comparator
exclude, toFind, transformsOnSearchedEntry
 
Constructor Summary
MethodComparator(java.lang.String[] toFind, java.lang.String[] exclude, boolean caseSensitive)
          Creates a new MethodComparator 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 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

MethodComparator

public MethodComparator(java.lang.String[] toFind,
                        java.lang.String[] exclude,
                        boolean caseSensitive)
Creates a new MethodComparator 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.
Method Detail

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.