[MOBY-guts] biomoby commit

Eddie Kawas kawas at pub.open-bio.org
Fri May 13 19:20:14 UTC 2005


kawas
Fri May 13 15:20:14 EDT 2005
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared
In directory pub.open-bio.org:/tmp/cvs-serv2332/org/biomoby/shared

Modified Files:
      Tag: java_1_5_compat
	MobyObjectDecompositionImpl.java MobyObjectDecomposition.java 
Log Message:
Changed the import statements and references to MobyDataSimpleInstance to MobyDataObject. Seems to be the right change.
Eddie

moby-live/Java/src/main/org/biomoby/shared MobyObjectDecompositionImpl.java,1.1,1.1.2.1 MobyObjectDecomposition.java,1.1,1.1.2.1
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyObjectDecompositionImpl.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyObjectDecompositionImpl.java	2005/04/07 16:37:02	1.1
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyObjectDecompositionImpl.java	2005/05/13 19:20:14	1.1.2.1
@@ -18,6 +18,7 @@
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 
+import org.biomoby.shared.data.*;
 import org.biomoby.client.CentralImpl;
 import org.biomoby.client.ui.graphical.applets.util.PrimitiveTypes;
 import org.w3c.dom.Document;
@@ -44,10 +45,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 +82,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 +105,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 +127,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 +140,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 +272,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 +281,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 +290,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;
     }

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyObjectDecomposition.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyObjectDecomposition.java	2005/04/07 16:37:02	1.1
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyObjectDecomposition.java	2005/05/13 19:20:14	1.1.2.1
@@ -4,6 +4,8 @@
  */
 package org.biomoby.shared;
 
+import org.biomoby.shared.data.MobyDataObject;
+
 
 /**
  * @author Eddie Kawas
@@ -21,7 +23,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 MobyDataObject[] getFlattenedPrims(String object);
 
     /**
      *  




More information about the MOBY-guts mailing list