-// $Id$\r
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.taxeditor.annotatedlineeditor;\r
-\r
-import java.util.Comparator;\r
-\r
-import org.apache.log4j.Logger;\r
-\r
-import eu.etaxonomy.cdm.model.common.IdentifiableEntity;\r
-\r
-/**\r
- * @author p.ciardelli\r
- * @created 19.08.2009\r
- * @version 1.0\r
- */\r
-public class IdentifiableEntityComparator implements Comparator {\r
- private static final Logger logger = Logger\r
- .getLogger(IdentifiableEntityComparator.class);\r
- \r
- private boolean fIgnoreCase;\r
-\r
- private String getTitleCache(Object o) {\r
- return o == null || !(o instanceof IdentifiableEntity) ? \r
- null : ((IdentifiableEntity) o).getTitleCache();\r
- }\r
- \r
- /* (non-Javadoc)\r
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)\r
- */\r
- public int compare(Object o1, Object o2) {\r
- String titleCache1 = getTitleCache(o1);\r
- String titleCache2 = getTitleCache(o2);\r
- if (titleCache1 == null && titleCache2 == null) {\r
- return 0;\r
- }\r
- if (titleCache1 == null) {\r
- return -1;\r
- }\r
- if (titleCache2 == null) {\r
- return 1;\r
- } \r
- return fIgnoreCase ? titleCache1.compareToIgnoreCase(titleCache2) : \r
- titleCache1.compareTo(titleCache2);\r
- }\r
-}\r
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.annotatedlineeditor;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+
+/**
+ * <p>IdentifiableEntityComparator class.</p>
+ *
+ * @author p.ciardelli
+ * @created 19.08.2009
+ * @version 1.0
+ */
+public class IdentifiableEntityComparator implements Comparator {
+ private static final Logger logger = Logger
+ .getLogger(IdentifiableEntityComparator.class);
+
+ private boolean fIgnoreCase;
+
+ private String getTitleCache(Object o) {
+ return o == null || !(o instanceof IdentifiableEntity) ?
+ null : ((IdentifiableEntity) o).getTitleCache();
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+ */
+ /** {@inheritDoc} */
+ public int compare(Object o1, Object o2) {
+ String titleCache1 = getTitleCache(o1);
+ String titleCache2 = getTitleCache(o2);
+ if (titleCache1 == null && titleCache2 == null) {
+ return 0;
+ }
+ if (titleCache1 == null) {
+ return -1;
+ }
+ if (titleCache2 == null) {
+ return 1;
+ }
+ return fIgnoreCase ? titleCache1.compareToIgnoreCase(titleCache2) :
+ titleCache1.compareTo(titleCache2);
+ }
+}