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;
*
* @version $Revision$ $Date$
*/
-public class Tree extends TreeType
+public class Tree extends org.vamsas.client.object
implements java.io.Serializable
{
+ //--------------------------/
+ //- Class/Member Variables -/
+ //--------------------------/
+
+ /**
+ * Field _id
+ */
+ private java.lang.String _id;
+
+ /**
+ * Field _newickFormatList
+ */
+ private java.util.Vector _newickFormatList;
+
+ /**
+ * Field _provenance
+ */
+ private org.vamsas.objects.core.Provenance _provenance;
+
+
//----------------/
//- Constructors -/
//----------------/
public Tree()
{
super();
+ _newickFormatList = new Vector();
} //-- org.vamsas.objects.core.Tree()
//-----------/
/**
+ * Method addNewickFormat
+ *
+ *
+ *
+ * @param vNewickFormat
+ */
+ public void addNewickFormat(java.lang.String vNewickFormat)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ _newickFormatList.addElement(vNewickFormat);
+ } //-- void addNewickFormat(java.lang.String)
+
+ /**
+ * Method addNewickFormat
+ *
+ *
+ *
+ * @param index
+ * @param vNewickFormat
+ */
+ public void addNewickFormat(int index, java.lang.String vNewickFormat)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ _newickFormatList.insertElementAt(vNewickFormat, index);
+ } //-- void addNewickFormat(int, java.lang.String)
+
+ /**
+ * Method enumerateNewickFormat
+ *
+ *
+ *
+ * @return Enumeration
+ */
+ public java.util.Enumeration enumerateNewickFormat()
+ {
+ return _newickFormatList.elements();
+ } //-- java.util.Enumeration enumerateNewickFormat()
+
+ /**
* Note: hashCode() has not been overriden
*
* @param obj
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._newickFormatList != null) {
+ if (temp._newickFormatList == null) return false;
+ else if (!(this._newickFormatList.equals(temp._newickFormatList)))
+ return false;
+ }
+ else if (temp._newickFormatList != null)
+ return false;
+ if (this._provenance != null) {
+ if (temp._provenance == null) return false;
+ else if (!(this._provenance.equals(temp._provenance)))
+ return false;
+ }
+ else if (temp._provenance != null)
+ return false;
return true;
}
return false;
} //-- boolean equals(java.lang.Object)
/**
+ * Returns the value of field 'id'.
+ *
+ * @return String
+ * @return the value of field 'id'.
+ */
+ public java.lang.String getId()
+ {
+ return this._id;
+ } //-- java.lang.String getId()
+
+ /**
+ * Method getNewickFormat
+ *
+ *
+ *
+ * @param index
+ * @return String
+ */
+ public java.lang.String getNewickFormat(int index)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ //-- check bounds for index
+ if ((index < 0) || (index > _newickFormatList.size())) {
+ throw new IndexOutOfBoundsException("getNewickFormat: Index value '"+index+"' not in range [0.."+_newickFormatList.size()+ "]");
+ }
+
+ return (String)_newickFormatList.elementAt(index);
+ } //-- java.lang.String getNewickFormat(int)
+
+ /**
+ * Method getNewickFormat
+ *
+ *
+ *
+ * @return String
+ */
+ public java.lang.String[] getNewickFormat()
+ {
+ int size = _newickFormatList.size();
+ java.lang.String[] mArray = new java.lang.String[size];
+ for (int index = 0; index < size; index++) {
+ mArray[index] = (String)_newickFormatList.elementAt(index);
+ }
+ return mArray;
+ } //-- java.lang.String[] getNewickFormat()
+
+ /**
+ * Method getNewickFormatCount
+ *
+ *
+ *
+ * @return int
+ */
+ public int getNewickFormatCount()
+ {
+ return _newickFormatList.size();
+ } //-- int getNewickFormatCount()
+
+ /**
+ * Returns the value of field 'provenance'.
+ *
+ * @return Provenance
+ * @return the value of field 'provenance'.
+ */
+ public org.vamsas.objects.core.Provenance getProvenance()
+ {
+ return this._provenance;
+ } //-- org.vamsas.objects.core.Provenance getProvenance()
+
+ /**
* Method isValid
*
*
} //-- void marshal(org.xml.sax.ContentHandler)
/**
+ * Method removeAllNewickFormat
+ *
+ */
+ public void removeAllNewickFormat()
+ {
+ _newickFormatList.removeAllElements();
+ } //-- void removeAllNewickFormat()
+
+ /**
+ * Method removeNewickFormat
+ *
+ *
+ *
+ * @param index
+ * @return String
+ */
+ public java.lang.String removeNewickFormat(int index)
+ {
+ java.lang.Object obj = _newickFormatList.elementAt(index);
+ _newickFormatList.removeElementAt(index);
+ return (String)obj;
+ } //-- java.lang.String removeNewickFormat(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 setNewickFormat
+ *
+ *
+ *
+ * @param index
+ * @param vNewickFormat
+ */
+ public void setNewickFormat(int index, java.lang.String vNewickFormat)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ //-- check bounds for index
+ if ((index < 0) || (index > _newickFormatList.size())) {
+ throw new IndexOutOfBoundsException("setNewickFormat: Index value '"+index+"' not in range [0.."+_newickFormatList.size()+ "]");
+ }
+ _newickFormatList.setElementAt(vNewickFormat, index);
+ } //-- void setNewickFormat(int, java.lang.String)
+
+ /**
+ * Method setNewickFormat
+ *
+ *
+ *
+ * @param newickFormatArray
+ */
+ public void setNewickFormat(java.lang.String[] newickFormatArray)
+ {
+ //-- copy array
+ _newickFormatList.removeAllElements();
+ for (int i = 0; i < newickFormatArray.length; i++) {
+ _newickFormatList.addElement(newickFormatArray[i]);
+ }
+ } //-- void setNewickFormat(java.lang.String)
+
+ /**
+ * Sets the value of field 'provenance'.
+ *
+ * @param provenance the value of field 'provenance'.
+ */
+ public void setProvenance(org.vamsas.objects.core.Provenance provenance)
+ {
+ this._provenance = provenance;
+ } //-- void setProvenance(org.vamsas.objects.core.Provenance)
+
+ /**
* Method unmarshal
*
*