Changeset 253 for ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/model/ComponentDescription.java
- Timestamp:
- 03/18/10 16:20:42 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/model/ComponentDescription.java
r127 r253 1 1 package clarin.cmdi.componentregistry.model; 2 3 import java.util.Comparator; 2 4 3 5 import javax.xml.bind.annotation.XmlRootElement; … … 9 11 public class ComponentDescription extends AbstractDescription { 10 12 13 public static final Comparator<? super ComponentDescription> COMPARE_ON_GROUP_AND_NAME = new Comparator<ComponentDescription>() { 14 public int compare(ComponentDescription o1, ComponentDescription o2) { 15 int result=0; 16 if (o1.getGroupName() != null && o2.getGroupName() != null) 17 result = o1.getGroupName().compareTo(o2.getGroupName()); 18 if (result == 0) { 19 if (o1.getName() != null && o2.getName() != null) { 20 result = o1.getName().compareTo(o2.getName()); 21 } else { 22 result = o1.getId().compareTo(o2.getId()); 23 } 24 } 25 return result; 26 } 27 }; 28 11 29 private String groupName; 12 30
Note: See TracChangeset
for help on using the changeset viewer.