private java.util.Vector _newickList;
/**
+ * node identity and mapping data between tree representations
+ * and vamsas document objects
+ *
+ */
+ private java.util.Vector _treenodeList;
+
+ /**
* Field _propertyList.
*/
private java.util.Vector _propertyList;
public Tree() {
super();
this._newickList = new java.util.Vector();
+ this._treenodeList = new java.util.Vector();
this._propertyList = new java.util.Vector();
}
}
/**
+ *
+ *
+ * @param vTreenode
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void addTreenode(
+ final uk.ac.vamsas.objects.core.Treenode vTreenode)
+ throws java.lang.IndexOutOfBoundsException {
+ this._treenodeList.addElement(vTreenode);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vTreenode
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void addTreenode(
+ final int index,
+ final uk.ac.vamsas.objects.core.Treenode vTreenode)
+ throws java.lang.IndexOutOfBoundsException {
+ this._treenodeList.add(index, vTreenode);
+ }
+
+ /**
* Method enumerateNewick.
*
* @return an Enumeration over all
}
/**
+ * Method enumerateTreenode.
+ *
+ * @return an Enumeration over all
+ * uk.ac.vamsas.objects.core.Treenode elements
+ */
+ public java.util.Enumeration enumerateTreenode(
+ ) {
+ return this._treenodeList.elements();
+ }
+
+ /**
* Overrides the java.lang.Object.equals method.
*
* @param obj
}
else if (temp._newickList != null)
return false;
+ if (this._treenodeList != null) {
+ if (temp._treenodeList == null) return false;
+ else if (!(this._treenodeList.equals(temp._treenodeList)))
+ return false;
+ }
+ else if (temp._treenodeList != null)
+ return false;
if (this._propertyList != null) {
if (temp._propertyList == null) return false;
else if (!(this._propertyList.equals(temp._propertyList)))
}
/**
+ * Method getTreenode.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Treenode
+ * at the given index
+ */
+ public uk.ac.vamsas.objects.core.Treenode getTreenode(
+ final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._treenodeList.size()) {
+ throw new IndexOutOfBoundsException("getTreenode: Index value '" + index + "' not in range [0.." + (this._treenodeList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Treenode) _treenodeList.get(index);
+ }
+
+ /**
+ * Method getTreenode.Returns the contents of the collection in
+ * an Array. <p>Note: Just in case the collection contents
+ * are changing in another thread, we pass a 0-length Array of
+ * the correct type into the API call. This way we <i>know</i>
+ * that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Treenode[] getTreenode(
+ ) {
+ uk.ac.vamsas.objects.core.Treenode[] array = new uk.ac.vamsas.objects.core.Treenode[0];
+ return (uk.ac.vamsas.objects.core.Treenode[]) this._treenodeList.toArray(array);
+ }
+
+ /**
+ * Method getTreenodeAsReference.Returns a reference to
+ * '_treenodeList'. No type checking is performed on any
+ * modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getTreenodeAsReference(
+ ) {
+ return this._treenodeList;
+ }
+
+ /**
+ * Method getTreenodeCount.
+ *
+ * @return the size of this collection
+ */
+ public int getTreenodeCount(
+ ) {
+ return this._treenodeList.size();
+ }
+
+ /**
* Overrides the java.lang.Object.hashCode method.
* <p>
* The following steps came from <b>Effective Java Programming
if (_newickList != null) {
result = 37 * result + _newickList.hashCode();
}
+ if (_treenodeList != null) {
+ result = 37 * result + _treenodeList.hashCode();
+ }
if (_propertyList != null) {
result = 37 * result + _propertyList.hashCode();
}
}
/**
+ */
+ public void removeAllTreenode(
+ ) {
+ this._treenodeList.clear();
+ }
+
+ /**
* Method removeNewick.
*
* @param vNewick
}
/**
+ * Method removeTreenode.
+ *
+ * @param vTreenode
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeTreenode(
+ final uk.ac.vamsas.objects.core.Treenode vTreenode) {
+ boolean removed = _treenodeList.remove(vTreenode);
+ return removed;
+ }
+
+ /**
+ * Method removeTreenodeAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Treenode removeTreenodeAt(
+ final int index) {
+ java.lang.Object obj = this._treenodeList.remove(index);
+ return (uk.ac.vamsas.objects.core.Treenode) obj;
+ }
+
+ /**
* Sets the value of field 'id'. The field 'id' has the
* following description: Primary Key for vamsas object
* referencing
}
/**
+ *
+ *
+ * @param index
+ * @param vTreenode
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void setTreenode(
+ final int index,
+ final uk.ac.vamsas.objects.core.Treenode vTreenode)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._treenodeList.size()) {
+ throw new IndexOutOfBoundsException("setTreenode: Index value '" + index + "' not in range [0.." + (this._treenodeList.size() - 1) + "]");
+ }
+
+ this._treenodeList.set(index, vTreenode);
+ }
+
+ /**
+ *
+ *
+ * @param vTreenodeArray
+ */
+ public void setTreenode(
+ final uk.ac.vamsas.objects.core.Treenode[] vTreenodeArray) {
+ //-- copy array
+ _treenodeList.clear();
+
+ for (int i = 0; i < vTreenodeArray.length; i++) {
+ this._treenodeList.add(vTreenodeArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_treenodeList' by copying the given
+ * Vector. All elements will be checked for type safety.
+ *
+ * @param vTreenodeList the Vector to copy.
+ */
+ public void setTreenode(
+ final java.util.Vector vTreenodeList) {
+ // copy vector
+ this._treenodeList.clear();
+
+ this._treenodeList.addAll(vTreenodeList);
+ }
+
+ /**
+ * Sets the value of '_treenodeList' by setting it to the given
+ * Vector. No type checking is performed.
+ * @deprecated
+ *
+ * @param treenodeVector the Vector to set.
+ */
+ public void setTreenodeAsReference(
+ final java.util.Vector treenodeVector) {
+ this._treenodeList = treenodeVector;
+ }
+
+ /**
* Method unmarshal.
*
* @param reader