[MOBY-guts] biomoby commit

Paul Gordon gordonp at pub.open-bio.org
Thu May 12 05:19:20 UTC 2005


gordonp
Thu May 12 01:19:20 EDT 2005
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared
In directory pub.open-bio.org:/tmp/cvs-serv26341/src/main/org/biomoby/shared

Modified Files:
	MobyObjectDecomposition.java MobyObjectDecompositionImpl.java 
Log Message:
Updates to Eddie's code to deal with the new org.biomoby.shared.data instance class package

moby-live/Java/src/main/org/biomoby/shared MobyObjectDecomposition.java,1.3,1.4 MobyObjectDecompositionImpl.java,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyObjectDecomposition.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/MobyObjectDecomposition.java	2005/04/18 23:57:45	1.3
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyObjectDecomposition.java	2005/05/12 05:19:20	1.4
@@ -21,7 +21,7 @@
      * @param object - the object to flatten into its primitives.
      * @return - the full decomposition of an object into its primitives.
      */
-    public MobyDataSimpleInstance[] getFlattenedPrims(String object);
+    public org.biomoby.shared.data.MobyDataObject[] getFlattenedPrims(String object);
 
     /**
      *  
@@ -42,4 +42,4 @@
      */
     public boolean isPrimitive(String object);
 
-}
\ No newline at end of file
+}

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyObjectDecompositionImpl.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/MobyObjectDecompositionImpl.java	2005/04/18 23:57:45	1.3
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyObjectDecompositionImpl.java	2005/05/12 05:19:20	1.4
@@ -4,6 +4,8 @@
  */
 package org.biomoby.shared;
 
+import org.biomoby.shared.data.*;
+
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
@@ -44,10 +46,10 @@
     /* (non-Javadoc)
      * @see org.biomoby.client.gui.util.MobyObjectDecomposition#getFlattenedPrims(java.lang.String)
      */
-    public final MobyDataSimpleInstance[] getFlattenedPrims(String object) {
+    public final MobyDataObject[] getFlattenedPrims(String object) {
         ArrayList list = new ArrayList();
         if (isPrimitive(object)) {
-            return new MobyDataSimpleInstance[] {};
+            return new MobyDataObject[] {};
         }
         String lsid = "urn:lsid:biomoby.org:objectclass:" + object;
         String rdf = getObjectRDF(lsid);
@@ -81,11 +83,11 @@
                             : articleNode.getTextContent();
                     //                  TODO - recurse if object is not a primitive
                     if (isPrimitive(localName)) {
-                        MobyDataSimpleInstance mdsi = createPrimitiveType(
+                        MobyDataObject mdsi = createPrimitiveType(
                                 localName, articleName);
                         list.add(mdsi);
                     } else {
-                        MobyDataSimpleInstance[] recurseArray = getFlattenedPrims(localName);
+                        MobyDataObject[] recurseArray = getFlattenedPrims(localName);
                         for (int k = 0; k < recurseArray.length; k++) {
                             list.add(recurseArray[k]);
                         }
@@ -104,11 +106,11 @@
                                 : articleNode.getTextContent();
                         //                      TODO - recurse if object is not a primitive
                         if (isPrimitive(localName)) {
-                            MobyDataSimpleInstance mdsi = createPrimitiveType(
+                            MobyDataObject mdsi = createPrimitiveType(
                                     localName, articleName);
                             list.add(mdsi);
                         } else {
-                            MobyDataSimpleInstance[] recurseArray = getFlattenedPrims(localName);
+                            MobyDataObject[] recurseArray = getFlattenedPrims(localName);
                             for (int k = 0; k < recurseArray.length; k++) {
                                 list.add(recurseArray[k]);
                             }
@@ -126,7 +128,7 @@
                         _object = _object.substring(_object.indexOf("#") + 1);
                     }
                     if (isPrimitive(_object) && !_object.equals("Object")) {
-                        MobyDataSimpleInstance mdsi = new MobyDataSimpleInstance(
+                        MobyDataObject mdsi = new MobyDataObject(
                                 _object);
                         mdsi.setDataType(new MobyDataType(_object));
                         list.add(mdsi);
@@ -139,7 +141,7 @@
                         _object = _object.substring(_object.indexOf("#") + 1);
                     }
                     if (isPrimitive(_object) && !_object.equals("Object")) {
-                        MobyDataSimpleInstance mdsi = new MobyDataSimpleInstance(
+                        MobyDataObject mdsi = new MobyDataObject(
                                 _object);
                         mdsi.setDataType(new MobyDataType(_object));
                         list.add(mdsi);
@@ -271,7 +273,7 @@
     /*
      * method to create default DataTypes.
      */
-    public final MobyDataSimpleInstance createPrimitiveType(String localName,
+    public final MobyDataObject createPrimitiveType(String localName,
             String articleName) {
         if (localName.equalsIgnoreCase("Float")) {
             return new MobyDataFloat(articleName, 0.0);
@@ -280,7 +282,7 @@
         } else if (localName.equalsIgnoreCase("Integer")) {
             return new MobyDataInt(articleName, 0);
         } else if (localName.equalsIgnoreCase("DateTime")) {
-            MobyDataSimpleInstance mdsi = new MobyDataSimpleInstance(
+            MobyDataObject mdsi = new MobyDataObject(
                     articleName);
             mdsi.setDataType(new MobyDataType(localName));
             return mdsi;
@@ -289,12 +291,12 @@
         return null;
     }
 
-    private final MobyDataSimpleInstance[] convertArrayListToMoby(ArrayList list) {
+    private final MobyDataObject[] convertArrayListToMoby(ArrayList list) {
         int size = list.size();
-        MobyDataSimpleInstance[] mdsi = new MobyDataSimpleInstance[size];
+        MobyDataObject[] mdsi = new MobyDataObject[size];
         size = 0;
         for (Iterator x = list.iterator(); x.hasNext(); size++) {
-            mdsi[size] = (MobyDataSimpleInstance) x.next();
+            mdsi[size] = (MobyDataObject) x.next();
         }
         return mdsi;
     }
@@ -415,4 +417,4 @@
             return sb.toString();
         }
     }
-}
\ No newline at end of file
+}




More information about the MOBY-guts mailing list