appli.diff
Class FileCompar2

java.lang.Object
  extended byappli.diff.FileCompar2
All Implemented Interfaces:
java.util.Comparator

class FileCompar2
extends java.lang.Object
implements java.util.Comparator

Local class used as Comparator for file names, excluding a root part, specific to each filename item

Version:
1.0 Dec 2003
Author:
Marc Wenger/CDS

Field Summary
(package private)  int lenroot1
           
(package private)  int lenroot2
           
(package private)  java.lang.String root1
           
(package private)  java.lang.String root2
           
 
Constructor Summary
FileCompar2(java.lang.String root1, java.lang.String root2)
          Constructor
 
Method Summary
 int compare(java.lang.Object f1, java.lang.Object f2)
          Compare method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

root1

java.lang.String root1

root2

java.lang.String root2

lenroot1

int lenroot1

lenroot2

int lenroot2
Constructor Detail

FileCompar2

public FileCompar2(java.lang.String root1,
                   java.lang.String root2)
Constructor

Parameters:
root1 - the root part of the first compared filename, which should be excluded from the comparison
root2 - the root part of the first compared filename, which should be excluded from the comparison
Method Detail

compare

public int compare(java.lang.Object f1,
                   java.lang.Object f2)
Compare method. The calback method used by the sort

Specified by:
compare in interface java.util.Comparator
Parameters:
f1 - first filename in the comparison
f2 - second filename in the comparison
Returns:
value <0, =0, >0 depending on the comparison