[MOBY-guts] biomoby commit
Martin Senger
senger at pub.open-bio.org
Fri Oct 28 11:30:37 UTC 2005
senger
Fri Oct 28 07:30:37 EDT 2005
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared
In directory pub.open-bio.org:/tmp/cvs-serv13398/src/main/org/biomoby/shared
Modified Files:
MobyServiceType.java
Log Message:
moby-live/Java/src/main/org/biomoby/shared MobyServiceType.java,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyServiceType.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyServiceType.java 2005/10/27 04:15:23 1.3
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyServiceType.java 2005/10/28 11:30:37 1.4
@@ -6,7 +6,9 @@
//
package org.biomoby.shared;
+
import org.tulsoft.shared.UUtils;
+import java.util.Comparator;
/**
* A container representing a service type used in the Moby registry.
@@ -147,4 +149,17 @@
return Utils.format (this, indent);
}
+ /**************************************************************************
+ * Create a comparator for case-insensitive sorting of service types
+ * by their authorities.
+ *************************************************************************/
+ public static Comparator getAuthorityComparator() {
+ return new Comparator() {
+ public int compare (Object o1, Object o2) {
+ String a1 = ((MobyServiceType)o1).getAuthority();
+ String a2 = ((MobyServiceType)o2).getAuthority();
+ return (a1).compareToIgnoreCase ((String)a2);
+ }
+ };
+ }
}
More information about the MOBY-guts
mailing list