changeset 475:1fc30116efc3

modified DocuDirent.compareTo instead of ImageFileset.compareTo
author hertzhaft
date Wed, 12 Apr 2006 14:12:37 +0200
parents fb51443ca0ee
children 528b48e38e09
files servlet/src/digilib/io/DocuDirent.java servlet/src/digilib/io/ImageFileset.java
diffstat 2 files changed, 6 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/servlet/src/digilib/io/DocuDirent.java	Wed Apr 12 14:12:37 2006 +0200
+++ b/servlet/src/digilib/io/DocuDirent.java	Wed Apr 12 14:12:37 2006 +0200
@@ -150,11 +150,16 @@
 	}
 
 	/** Comparator using the file name.
+	 * Compares to a String (for binarySearch)
+     * or to another DocuDirent (for sort)
 	 * 
 	 * @see java.lang.Comparable#compareTo(java.lang.Object)
 	 */
 	public int compareTo(Object arg0) {
-		return (getName().compareTo((String) arg0));
+		return (arg0 instanceof DocuDirent)
+            ? getName().compareTo(((DocuDirent) arg0).getName())
+            : getName().compareTo((String) arg0);
 	}
+
 	
 }
--- a/servlet/src/digilib/io/ImageFileset.java	Wed Apr 12 14:12:37 2006 +0200
+++ b/servlet/src/digilib/io/ImageFileset.java	Wed Apr 12 14:12:37 2006 +0200
@@ -109,16 +109,6 @@
 	}
 
 	/**
-	 * Compares to a String (for binarySearch)
-     * or to another ImageFileset (for sort)
-	 */
-	public int compareTo(Object arg0) {
-		return (arg0 instanceof ImageFileset)
-            ? getName().compareTo(((ImageFileset) arg0).getName())
-            : getName().compareTo((String) arg0);
-	}
-
-	/**
 	 * Get the ImageFile at the index.
 	 * 
 	 *