ewe.util
Class FileComparer

java.lang.Object
  extended byewe.util.FileComparer
All Implemented Interfaces:
Comparer

public class FileComparer
extends Object
implements Comparer

A FileComparer compares two File objects according to criteria which include: name, length, type and modification date.


Field Summary
static char BackSlash
           
 boolean caseSensitive
           
protected  File check1
           
protected  File check2
           
static char DriveSeparator
           
static char ForwardSlash
           
static int IGNORE_CASE
           
 boolean letAll
           
protected  Locale locale
           
protected  String mask
           
static char MySeparator
           
protected  int options
           
protected  File parent
           
protected  Time time
           
 
Constructor Summary
FileComparer(File parent, Locale locale, int options, String mask)
           
 
Method Summary
 boolean accept(File dir, Object nameOrFile)
           
 int compare(Object one, Object two)
          This should compare the two objects and return: 0 = the objects are equal.
static int findLastSeparator(String full)
           
protected static int findLastSeparatorDrive(String full)
           
static String getDrivePath(String full)
           
static String getExt(String full)
           
static String getFile(String full)
           
static String getFileExt(String full)
           
 boolean matches(String fileName)
           
 void setMask(String mask)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Field Detail

ForwardSlash

public static char ForwardSlash

BackSlash

public static char BackSlash

DriveSeparator

public static char DriveSeparator

MySeparator

public static char MySeparator

IGNORE_CASE

public static final int IGNORE_CASE
See Also:
Constant Field Values

mask

protected String mask

parent

protected File parent

options

protected int options

check1

protected File check1

check2

protected File check2

locale

protected Locale locale

time

protected Time time

caseSensitive

public boolean caseSensitive

letAll

public boolean letAll
Constructor Detail

FileComparer

public FileComparer(File parent,
                    Locale locale,
                    int options,
                    String mask)
Parameters:
parent - The parent file for the files to be compared.
locale - a Locale to use for comparisons.
options - This should be the File.LIST_XXX options.
mask - An optional mask for comparing a File with a mask.
Method Detail

setMask

public void setMask(String mask)

compare

public int compare(Object one,
                   Object two)
Description copied from interface: Comparer
This should compare the two objects and return: 0 = the objects are equal. greater than 0 = one is greater than two. less than 0 = two is greater than one.

Specified by:
compare in interface Comparer

findLastSeparatorDrive

protected static int findLastSeparatorDrive(String full)

findLastSeparator

public static int findLastSeparator(String full)

getExt

public static String getExt(String full)

getFile

public static String getFile(String full)

matches

public boolean matches(String fileName)

accept

public boolean accept(File dir,
                      Object nameOrFile)

getDrivePath

public static String getDrivePath(String full)

getFileExt

public static String getFileExt(String full)