[MOBY-guts] biomoby commit

Paul Gordon gordonp at pub.open-bio.org
Tue Aug 9 19:40:57 UTC 2005


gordonp
Tue Aug  9 15:40:56 EDT 2005
Update of /home/repository/moby/moby-live/Java/docs
In directory pub.open-bio.org:/tmp/cvs-serv3899

Modified Files:
	SimpleClient.html 
Log Message:
Added Comparable docs, and fixed typos in sequence object composition code

moby-live/Java/docs SimpleClient.html,1.9,1.10
===================================================================
RCS file: /home/repository/moby/moby-live/Java/docs/SimpleClient.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- /home/repository/moby/moby-live/Java/docs/SimpleClient.html	2005/08/07 23:46:11	1.9
+++ /home/repository/moby/moby-live/Java/docs/SimpleClient.html	2005/08/09 19:40:56	1.10
@@ -190,8 +190,8 @@
 <blockquote><code><pre>
 String aaSequence = "MPGGFILAIDEGTTSARAIIYNQDLEVLGIGQYDFPQHYPSPGYVEHNPDEIWNAQMLAI";
 MobyDataComposite aaSequenceObject = new MobyDataComposite("AminoAcidSequence");
-aaSequence.put("SequenceString", new MobyDataString(aaSequence));
-aaSequence.put("Length", new MobyDataInt(aaSequence.length()));
+aaSequenceObject.put("SequenceString", new MobyDataString(aaSequence));
+aaSequenceObject.put("Length", new MobyDataInt(aaSequence.length()));
 </pre></code></blockquote>
 
 </p>
@@ -340,6 +340,18 @@
 The math functions have been written to maintain as much numerical precision as possible.
 </p>
 
+<h3>Comparing Objects</h3>
+<p>
+Another convenient thing about the jMOBY objects is that they implement the 
+<code><a href="http://www.javadocs.org/Comparable">java.lang.Comparable</a></code> interface.
+They have implemented the <code>equals</code> and <code>compareTo</code> methods to be
+much more forgiving than the underlying data types, which throw exceptions at comparison with anything
+but their own class. Any object in the jMOBY hierarchy can be compared to any other.
+If objects values are the same (e.g. the String 2.0 and the float 2.0), the <em>namespace</em> and <em>ID</em>
+are used to sort. This sorting implementation is very convenient for putting the objects
+into tabular format.
+</p>
+
     <hr/>
     <a name="creatingMOBYXML"></a>
     <h2>Creating MOBY XML (responses and queries)</h2>




More information about the MOBY-guts mailing list