-// $Id$
/**
* Copyright (C) 2009 EDIT
-* European Distributed Institute of Taxonomy
+* 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.
*/
import java.util.Comparator;
-import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.term.DefinedTermBase;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
* Implements a {@link Comparator} for {@link DefinedTermBase} objects based on the term's label.
* The compare algorithm compares a term's label. Example: If used on an unsorted list of terms, the
* list will be alphabetically sorted by label afterwards.
- *
+ *
* @author n.hoffmann
* @date Jan 18, 2012
*
}
String label1 = o1.getLabel(CdmStore.getDefaultLanguage()) != null ? o1.getLabel(CdmStore.getDefaultLanguage()) : o1.getTitleCache();
String label2 = o2.getLabel(CdmStore.getDefaultLanguage()) != null ? o2.getLabel(CdmStore.getDefaultLanguage()) : o2.getTitleCache();
- return label1.compareTo(label2);
+ int result = label1.compareTo(label2);
+ if (result == 0){
+ return o1.getUuid().compareTo(o2.getUuid());
+ }
+ return result;
}
};