schema changes: provenance-entry-date is now an xmlSchema:dateTime bound directly...
[vamsas.git] / src / uk / ac / vamsas / objects / core / Sequence.java
index d4ff049..03ea13a 100644 (file)
@@ -47,6 +47,13 @@ implements java.io.Serializable
      */
     private java.util.Vector _dbRefList;
 
+    /**
+     * explicitly named cross reference to other objects in the
+     * document.
+     *  
+     */
+    private java.util.Vector _vxrefList;
+
 
       //----------------/
      //- Constructors -/
@@ -55,6 +62,7 @@ implements java.io.Serializable
     public Sequence() {
         super();
         this._dbRefList = new java.util.Vector();
+        this._vxrefList = new java.util.Vector();
     }
 
 
@@ -91,6 +99,34 @@ implements java.io.Serializable
     }
 
     /**
+     * 
+     * 
+     * @param vVxref
+     * @throws java.lang.IndexOutOfBoundsException if the index
+     * given is outside the bounds of the collection
+     */
+    public void addVxref(
+            final uk.ac.vamsas.objects.core.Vxref vVxref)
+    throws java.lang.IndexOutOfBoundsException {
+        this._vxrefList.addElement(vVxref);
+    }
+
+    /**
+     * 
+     * 
+     * @param index
+     * @param vVxref
+     * @throws java.lang.IndexOutOfBoundsException if the index
+     * given is outside the bounds of the collection
+     */
+    public void addVxref(
+            final int index,
+            final uk.ac.vamsas.objects.core.Vxref vVxref)
+    throws java.lang.IndexOutOfBoundsException {
+        this._vxrefList.add(index, vVxref);
+    }
+
+    /**
      * Method enumerateDbRef.
      * 
      * @return an Enumeration over all
@@ -102,6 +138,17 @@ implements java.io.Serializable
     }
 
     /**
+     * Method enumerateVxref.
+     * 
+     * @return an Enumeration over all
+     * uk.ac.vamsas.objects.core.Vxref elements
+     */
+    public java.util.Enumeration enumerateVxref(
+    ) {
+        return this._vxrefList.elements();
+    }
+
+    /**
      * Overrides the java.lang.Object.equals method.
      * 
      * @param obj
@@ -139,6 +186,13 @@ implements java.io.Serializable
             }
             else if (temp._dbRefList != null)
                 return false;
+            if (this._vxrefList != null) {
+                if (temp._vxrefList == null) return false;
+                else if (!(this._vxrefList.equals(temp._vxrefList))) 
+                    return false;
+            }
+            else if (temp._vxrefList != null)
+                return false;
             return true;
         }
         return false;
@@ -228,6 +282,63 @@ implements java.io.Serializable
     }
 
     /**
+     * Method getVxref.
+     * 
+     * @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.Vxref at
+     * the given index
+     */
+    public uk.ac.vamsas.objects.core.Vxref getVxref(
+            final int index)
+    throws java.lang.IndexOutOfBoundsException {
+        // check bounds for index
+        if (index < 0 || index >= this._vxrefList.size()) {
+            throw new IndexOutOfBoundsException("getVxref: Index value '" + index + "' not in range [0.." + (this._vxrefList.size() - 1) + "]");
+        }
+        
+        return (uk.ac.vamsas.objects.core.Vxref) _vxrefList.get(index);
+    }
+
+    /**
+     * Method getVxref.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.Vxref[] getVxref(
+    ) {
+        uk.ac.vamsas.objects.core.Vxref[] array = new uk.ac.vamsas.objects.core.Vxref[0];
+        return (uk.ac.vamsas.objects.core.Vxref[]) this._vxrefList.toArray(array);
+    }
+
+    /**
+     * Method getVxrefAsReference.Returns a reference to
+     * '_vxrefList'. No type checking is performed on any
+     * modifications to the Vector.
+     * 
+     * @return a reference to the Vector backing this class
+     */
+    public java.util.Vector getVxrefAsReference(
+    ) {
+        return this._vxrefList;
+    }
+
+    /**
+     * Method getVxrefCount.
+     * 
+     * @return the size of this collection
+     */
+    public int getVxrefCount(
+    ) {
+        return this._vxrefList.size();
+    }
+
+    /**
      * Overrides the java.lang.Object.hashCode method.
      * <p>
      * The following steps came from <b>Effective Java Programming
@@ -249,6 +360,9 @@ implements java.io.Serializable
         if (_dbRefList != null) {
            result = 37 * result + _dbRefList.hashCode();
         }
+        if (_vxrefList != null) {
+           result = 37 * result + _vxrefList.hashCode();
+        }
         
         return result;
     }
@@ -308,6 +422,13 @@ implements java.io.Serializable
     }
 
     /**
+     */
+    public void removeAllVxref(
+    ) {
+        this._vxrefList.clear();
+    }
+
+    /**
      * Method removeDbRef.
      * 
      * @param vDbRef
@@ -332,6 +453,30 @@ implements java.io.Serializable
     }
 
     /**
+     * Method removeVxref.
+     * 
+     * @param vVxref
+     * @return true if the object was removed from the collection.
+     */
+    public boolean removeVxref(
+            final uk.ac.vamsas.objects.core.Vxref vVxref) {
+        boolean removed = _vxrefList.remove(vVxref);
+        return removed;
+    }
+
+    /**
+     * Method removeVxrefAt.
+     * 
+     * @param index
+     * @return the element removed from the collection
+     */
+    public uk.ac.vamsas.objects.core.Vxref removeVxrefAt(
+            final int index) {
+        java.lang.Object obj = this._vxrefList.remove(index);
+        return (uk.ac.vamsas.objects.core.Vxref) obj;
+    }
+
+    /**
      * 
      * 
      * @param index
@@ -418,6 +563,67 @@ implements java.io.Serializable
     }
 
     /**
+     * 
+     * 
+     * @param index
+     * @param vVxref
+     * @throws java.lang.IndexOutOfBoundsException if the index
+     * given is outside the bounds of the collection
+     */
+    public void setVxref(
+            final int index,
+            final uk.ac.vamsas.objects.core.Vxref vVxref)
+    throws java.lang.IndexOutOfBoundsException {
+        // check bounds for index
+        if (index < 0 || index >= this._vxrefList.size()) {
+            throw new IndexOutOfBoundsException("setVxref: Index value '" + index + "' not in range [0.." + (this._vxrefList.size() - 1) + "]");
+        }
+        
+        this._vxrefList.set(index, vVxref);
+    }
+
+    /**
+     * 
+     * 
+     * @param vVxrefArray
+     */
+    public void setVxref(
+            final uk.ac.vamsas.objects.core.Vxref[] vVxrefArray) {
+        //-- copy array
+        _vxrefList.clear();
+        
+        for (int i = 0; i < vVxrefArray.length; i++) {
+                this._vxrefList.add(vVxrefArray[i]);
+        }
+    }
+
+    /**
+     * Sets the value of '_vxrefList' by copying the given Vector.
+     * All elements will be checked for type safety.
+     * 
+     * @param vVxrefList the Vector to copy.
+     */
+    public void setVxref(
+            final java.util.Vector vVxrefList) {
+        // copy vector
+        this._vxrefList.clear();
+        
+        this._vxrefList.addAll(vVxrefList);
+    }
+
+    /**
+     * Sets the value of '_vxrefList' by setting it to the given
+     * Vector. No type checking is performed.
+     * @deprecated
+     * 
+     * @param vxrefVector the Vector to set.
+     */
+    public void setVxrefAsReference(
+            final java.util.Vector vxrefVector) {
+        this._vxrefList = vxrefVector;
+    }
+
+    /**
      * Method unmarshal.
      * 
      * @param reader