[MOBY-guts] biomoby commit

senger at ebi.ac.uk senger at pub.open-bio.org
Fri Oct 17 10:13:35 EDT 2003


senger
Fri Oct 17 09:13:35 EDT 2003
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared
In directory pub.open-bio.org:/tmp/cvs-serv29602/src/main/org/biomoby/shared

Modified Files:
	Utils.java 
Log Message:
first draft of graphs

moby-live/Java/src/main/org/biomoby/shared Utils.java,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java	2003/09/24 14:33:37	1.1
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java	2003/10/17 13:13:35	1.2
@@ -176,13 +176,34 @@
      * Find and return an instance of a DOM parser wrapper.
      * It does the same as method {@link #getDOMParser(String)} except that it
      * does not get any parser class name in the parameter.
-     *<p>
+     * <p>
+     *
      * @return an instance of a DOM parser wrapper
      * @see #getDOMParser(String)
-     * @throws MobyException if unable to instantiate specified DOM parser
+     * @throws MobyException if unable to instantiate the specified DOM parser
      *************************************************************************/
     public static ParserWrapper getDOMParser()
 	throws MobyException {
 	return getDOMParser (null);
     }
+
+    /*************************************************************************
+     * Return just the last part of the LSID identifier. An example of
+     * an LSID identrifier as used by and returned from the Moby
+     * registry is <tt>urn:lsid:biomoby.org:objectclass:object</tt>.
+     * <p>
+     *
+     * @param lsid is an input
+     * @return the last part of 'lsid', or the whole 'lsid' if it does
+     * not contain any colon (which is a delimiter used by LSID
+     * identifiers)
+     *************************************************************************/
+    public static String pureName (String lsid) {
+	if (lsid == null) return lsid;
+	int pos = lsid.lastIndexOf (":");
+	if (pos < 0 || pos == lsid.length() - 1) return lsid;
+	return lsid.substring (pos + 1);
+    }
+
+
 }



More information about the MOBY-guts mailing list