fixed a slight bug in AppData entry searching, and introduced generic AppData entry...
[vamsas.git] / src / org / vamsas / objects / core / Tree.java
index 7687cbb..a6cbad3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This class was automatically generated with 
- * <a href="http://www.castor.org">Castor 0.9.9M1</a>, using an XML
+ * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
  * Schema.
  * $Id$
  */
@@ -15,6 +15,8 @@ import java.io.IOException;
 import java.io.Reader;
 import java.io.Serializable;
 import java.io.Writer;
+import java.util.Enumeration;
+import java.util.Vector;
 import org.exolab.castor.xml.MarshalException;
 import org.exolab.castor.xml.Marshaller;
 import org.exolab.castor.xml.Unmarshaller;
@@ -36,14 +38,24 @@ implements java.io.Serializable
     //--------------------------/
 
     /**
-     * Field _provenance
+     * Field _id
      */
-    private org.vamsas.objects.core.Provenance _provenance;
+    private java.lang.String _id;
+
+    /**
+     * Field _title
+     */
+    private java.lang.String _title;
+
+    /**
+     * Field _newickList
+     */
+    private java.util.Vector _newickList;
 
     /**
-     * Field _newickFormat
+     * Field _provenance
      */
-    private java.lang.String _newickFormat;
+    private org.vamsas.objects.core.Provenance _provenance;
 
 
       //----------------/
@@ -53,6 +65,7 @@ implements java.io.Serializable
     public Tree() 
      {
         super();
+        _newickList = new Vector();
     } //-- org.vamsas.objects.core.Tree()
 
 
@@ -61,6 +74,45 @@ implements java.io.Serializable
     //-----------/
 
     /**
+     * Method addNewick
+     * 
+     * 
+     * 
+     * @param vNewick
+     */
+    public void addNewick(org.vamsas.objects.core.Newick vNewick)
+        throws java.lang.IndexOutOfBoundsException
+    {
+        _newickList.addElement(vNewick);
+    } //-- void addNewick(org.vamsas.objects.core.Newick) 
+
+    /**
+     * Method addNewick
+     * 
+     * 
+     * 
+     * @param index
+     * @param vNewick
+     */
+    public void addNewick(int index, org.vamsas.objects.core.Newick vNewick)
+        throws java.lang.IndexOutOfBoundsException
+    {
+        _newickList.insertElementAt(vNewick, index);
+    } //-- void addNewick(int, org.vamsas.objects.core.Newick) 
+
+    /**
+     * Method enumerateNewick
+     * 
+     * 
+     * 
+     * @return Enumeration
+     */
+    public java.util.Enumeration enumerateNewick()
+    {
+        return _newickList.elements();
+    } //-- java.util.Enumeration enumerateNewick() 
+
+    /**
      * Note: hashCode() has not been overriden
      * 
      * @param obj
@@ -77,6 +129,27 @@ implements java.io.Serializable
         if (obj instanceof Tree) {
         
             Tree temp = (Tree)obj;
+            if (this._id != null) {
+                if (temp._id == null) return false;
+                else if (!(this._id.equals(temp._id))) 
+                    return false;
+            }
+            else if (temp._id != null)
+                return false;
+            if (this._title != null) {
+                if (temp._title == null) return false;
+                else if (!(this._title.equals(temp._title))) 
+                    return false;
+            }
+            else if (temp._title != null)
+                return false;
+            if (this._newickList != null) {
+                if (temp._newickList == null) return false;
+                else if (!(this._newickList.equals(temp._newickList))) 
+                    return false;
+            }
+            else if (temp._newickList != null)
+                return false;
             if (this._provenance != null) {
                 if (temp._provenance == null) return false;
                 else if (!(this._provenance.equals(temp._provenance))) 
@@ -84,28 +157,69 @@ implements java.io.Serializable
             }
             else if (temp._provenance != null)
                 return false;
-            if (this._newickFormat != null) {
-                if (temp._newickFormat == null) return false;
-                else if (!(this._newickFormat.equals(temp._newickFormat))) 
-                    return false;
-            }
-            else if (temp._newickFormat != null)
-                return false;
             return true;
         }
         return false;
     } //-- boolean equals(java.lang.Object) 
 
     /**
-     * Returns the value of field 'newickFormat'.
+     * Returns the value of field 'id'.
      * 
      * @return String
-     * @return the value of field 'newickFormat'.
+     * @return the value of field 'id'.
+     */
+    public java.lang.String getId()
+    {
+        return this._id;
+    } //-- java.lang.String getId() 
+
+    /**
+     * Method getNewick
+     * 
+     * 
+     * 
+     * @param index
+     * @return Newick
+     */
+    public org.vamsas.objects.core.Newick getNewick(int index)
+        throws java.lang.IndexOutOfBoundsException
+    {
+        //-- check bounds for index
+        if ((index < 0) || (index > _newickList.size())) {
+            throw new IndexOutOfBoundsException("getNewick: Index value '"+index+"' not in range [0.."+_newickList.size()+ "]");
+        }
+        
+        return (org.vamsas.objects.core.Newick) _newickList.elementAt(index);
+    } //-- org.vamsas.objects.core.Newick getNewick(int) 
+
+    /**
+     * Method getNewick
+     * 
+     * 
+     * 
+     * @return Newick
+     */
+    public org.vamsas.objects.core.Newick[] getNewick()
+    {
+        int size = _newickList.size();
+        org.vamsas.objects.core.Newick[] mArray = new org.vamsas.objects.core.Newick[size];
+        for (int index = 0; index < size; index++) {
+            mArray[index] = (org.vamsas.objects.core.Newick) _newickList.elementAt(index);
+        }
+        return mArray;
+    } //-- org.vamsas.objects.core.Newick[] getNewick() 
+
+    /**
+     * Method getNewickCount
+     * 
+     * 
+     * 
+     * @return int
      */
-    public java.lang.String getNewickFormat()
+    public int getNewickCount()
     {
-        return this._newickFormat;
-    } //-- java.lang.String getNewickFormat() 
+        return _newickList.size();
+    } //-- int getNewickCount() 
 
     /**
      * Returns the value of field 'provenance'.
@@ -119,6 +233,17 @@ implements java.io.Serializable
     } //-- org.vamsas.objects.core.Provenance getProvenance() 
 
     /**
+     * Returns the value of field 'title'.
+     * 
+     * @return String
+     * @return the value of field 'title'.
+     */
+    public java.lang.String getTitle()
+    {
+        return this._title;
+    } //-- java.lang.String getTitle() 
+
+    /**
      * Method isValid
      * 
      * 
@@ -165,14 +290,72 @@ implements java.io.Serializable
     } //-- void marshal(org.xml.sax.ContentHandler) 
 
     /**
-     * Sets the value of field 'newickFormat'.
+     * Method removeAllNewick
+     * 
+     */
+    public void removeAllNewick()
+    {
+        _newickList.removeAllElements();
+    } //-- void removeAllNewick() 
+
+    /**
+     * Method removeNewick
+     * 
+     * 
      * 
-     * @param newickFormat the value of field 'newickFormat'.
+     * @param index
+     * @return Newick
      */
-    public void setNewickFormat(java.lang.String newickFormat)
+    public org.vamsas.objects.core.Newick removeNewick(int index)
     {
-        this._newickFormat = newickFormat;
-    } //-- void setNewickFormat(java.lang.String) 
+        java.lang.Object obj = _newickList.elementAt(index);
+        _newickList.removeElementAt(index);
+        return (org.vamsas.objects.core.Newick) obj;
+    } //-- org.vamsas.objects.core.Newick removeNewick(int) 
+
+    /**
+     * Sets the value of field 'id'.
+     * 
+     * @param id the value of field 'id'.
+     */
+    public void setId(java.lang.String id)
+    {
+        this._id = id;
+    } //-- void setId(java.lang.String) 
+
+    /**
+     * Method setNewick
+     * 
+     * 
+     * 
+     * @param index
+     * @param vNewick
+     */
+    public void setNewick(int index, org.vamsas.objects.core.Newick vNewick)
+        throws java.lang.IndexOutOfBoundsException
+    {
+        //-- check bounds for index
+        if ((index < 0) || (index > _newickList.size())) {
+            throw new IndexOutOfBoundsException("setNewick: Index value '"+index+"' not in range [0.."+_newickList.size()+ "]");
+        }
+        _newickList.setElementAt(vNewick, index);
+    } //-- void setNewick(int, org.vamsas.objects.core.Newick) 
+
+    /**
+     * Method setNewick
+     * 
+     * 
+     * 
+     * @param newickArray
+     */
+    public void setNewick(org.vamsas.objects.core.Newick[] newickArray)
+    {
+        //-- copy array
+        _newickList.removeAllElements();
+        for (int i = 0; i < newickArray.length; i++) {
+            _newickList.addElement(newickArray[i]);
+        }
+    } //-- void setNewick(org.vamsas.objects.core.Newick) 
 
     /**
      * Sets the value of field 'provenance'.
@@ -185,6 +368,16 @@ implements java.io.Serializable
     } //-- void setProvenance(org.vamsas.objects.core.Provenance) 
 
     /**
+     * Sets the value of field 'title'.
+     * 
+     * @param title the value of field 'title'.
+     */
+    public void setTitle(java.lang.String title)
+    {
+        this._title = title;
+    } //-- void setTitle(java.lang.String) 
+
+    /**
      * Method unmarshal
      * 
      *