[MOBY-guts] biomoby commit

Martin Senger senger at pub.open-bio.org
Fri Oct 28 13:39:09 UTC 2005


senger
Fri Oct 28 09:39:09 EDT 2005
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared
In directory pub.open-bio.org:/tmp/cvs-serv13861/src/main/org/biomoby/shared

Modified Files:
	MobyNamespace.java 
Log Message:


moby-live/Java/src/main/org/biomoby/shared MobyNamespace.java,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.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/MobyNamespace.java	2005/10/27 04:15:23	1.3
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java	2005/10/28 13:39:09	1.4
@@ -6,7 +6,9 @@
 //
 
 package org.biomoby.shared;
+
 import org.tulsoft.shared.UUtils;
+import java.util.Comparator;
 
 /**
  * A container representing a namespace used in the Moby registry.
@@ -100,4 +102,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 = ((MobyNamespace)o1).getAuthority();
+		    String a2 = ((MobyNamespace)o2).getAuthority();
+		    return (a1).compareToIgnoreCase ((String)a2);
+		}
+	    };
+    }
 }




More information about the MOBY-guts mailing list