|
From: <de...@us...> - 2003-08-19 07:44:24
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers
In directory sc8-pr-cvs1:/tmp/cvs-serv9684/fichiers
Modified Files:
FileFormat.java
Log Message:
Maj des import
Index: FileFormat.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers/FileFormat.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FileFormat.java 18 Aug 2003 11:05:19 -0000 1.2
--- FileFormat.java 19 Aug 2003 07:44:21 -0000 1.3
***************
*** 10,13 ****
--- 10,14 ----
import java.io.File;
+ import java.util.Comparator;
import com.memoire.bu.BuInformationsSoftware;
***************
*** 39,49 ****
nbFile_= _nbFile;
}
!
! public int getVersionNb(){
return 1;
}
public String[] getVersions() {
! return new String[]{getLastVersion()};
}
--- 40,50 ----
nbFile_= _nbFile;
}
!
! public int getVersionNb() {
return 1;
}
public String[] getVersions() {
! return new String[] { getLastVersion()};
}
***************
*** 124,127 ****
--- 125,147 ----
}
return r;
+ }
+
+ /**
+ * Ce comparateur permet de classer des formats selon leurs nom (ATTENTION 2
+ * formats avec le meme nom seront supposes egaux).
+ */
+ public static class FileFormatNameComparator implements Comparator {
+
+ /**
+ * Compare 2 FileFormat selon le nom (uniquement).
+ */
+ public int compare(Object o1, Object o2) {
+ if (!(o1 instanceof FileFormat))
+ throw new IllegalArgumentException("o1 doit etre de type FileFormat");
+ if (!(o2 instanceof FileFormat))
+ throw new IllegalArgumentException("o2 doit etre de type FileFormat");
+ return ((FileFormat)o1).getName().compareTo(((FileFormat)o2).getName());
+ }
+
}
|