schema changes: provenance-entry-date is now an xmlSchema:dateTime bound directly...
[vamsas.git] / src / uk / ac / vamsas / objects / core / Input.java
index 5d8b2b3..3ad7a8e 100644 (file)
@@ -37,7 +37,7 @@ implements java.io.Serializable
      * Reference Frame for rangeType specfication\r
      *  \r
      */\r
-    private java.lang.Object _objRef;\r
+    private java.util.Vector _objRef;\r
 \r
 \r
       //----------------/\r
@@ -46,6 +46,7 @@ implements java.io.Serializable
 \r
     public Input() {\r
         super();\r
+        this._objRef = new java.util.Vector();\r
     }\r
 \r
 \r
@@ -54,6 +55,44 @@ implements java.io.Serializable
     //-----------/\r
 \r
     /**\r
+     * \r
+     * \r
+     * @param vObjRef\r
+     * @throws java.lang.IndexOutOfBoundsException if the index\r
+     * given is outside the bounds of the collection\r
+     */\r
+    public void addObjRef(\r
+            final java.lang.Object vObjRef)\r
+    throws java.lang.IndexOutOfBoundsException {\r
+        this._objRef.addElement(vObjRef);\r
+    }\r
+\r
+    /**\r
+     * \r
+     * \r
+     * @param index\r
+     * @param vObjRef\r
+     * @throws java.lang.IndexOutOfBoundsException if the index\r
+     * given is outside the bounds of the collection\r
+     */\r
+    public void addObjRef(\r
+            final int index,\r
+            final java.lang.Object vObjRef)\r
+    throws java.lang.IndexOutOfBoundsException {\r
+        this._objRef.add(index, vObjRef);\r
+    }\r
+\r
+    /**\r
+     * Method enumerateObjRef.\r
+     * \r
+     * @return an Enumeration over all java.lang.Object elements\r
+     */\r
+    public java.util.Enumeration enumerateObjRef(\r
+    ) {\r
+        return this._objRef.elements();\r
+    }\r
+\r
+    /**\r
      * Overrides the java.lang.Object.equals method.\r
      * \r
      * @param obj\r
@@ -100,19 +139,62 @@ implements java.io.Serializable
     }\r
 \r
     /**\r
-     * Returns the value of field 'objRef'. The field 'objRef' has\r
-     * the following description: Reference Frame for rangeType\r
-     * specfication\r
-     *  \r
+     * Method getObjRef.\r
      * \r
-     * @return the value of field 'ObjRef'.\r
+     * @param index\r
+     * @throws java.lang.IndexOutOfBoundsException if the index\r
+     * given is outside the bounds of the collection\r
+     * @return the value of the java.lang.Object at the given index\r
      */\r
     public java.lang.Object getObjRef(\r
+            final int index)\r
+    throws java.lang.IndexOutOfBoundsException {\r
+        // check bounds for index\r
+        if (index < 0 || index >= this._objRef.size()) {\r
+            throw new IndexOutOfBoundsException("getObjRef: Index value '" + index + "' not in range [0.." + (this._objRef.size() - 1) + "]");\r
+        }\r
+        \r
+        return _objRef.get(index);\r
+    }\r
+\r
+    /**\r
+     * Method getObjRef.Returns the contents of the collection in\r
+     * an Array.  <p>Note:  Just in case the collection contents\r
+     * are changing in another thread, we pass a 0-length Array of\r
+     * the correct type into the API call.  This way we <i>know</i>\r
+     * that the Array returned is of exactly the correct length.\r
+     * \r
+     * @return this collection as an Array\r
+     */\r
+    public java.lang.Object[] getObjRef(\r
+    ) {\r
+        java.lang.Object[] array = new java.lang.Object[0];\r
+        return (java.lang.Object[]) this._objRef.toArray(array);\r
+    }\r
+\r
+    /**\r
+     * Method getObjRefAsReference.Returns a reference to\r
+     * '_objRef'. No type checking is performed on any\r
+     * modifications to the Vector.\r
+     * \r
+     * @return a reference to the Vector backing this class\r
+     */\r
+    public java.util.Vector getObjRefAsReference(\r
     ) {\r
         return this._objRef;\r
     }\r
 \r
     /**\r
+     * Method getObjRefCount.\r
+     * \r
+     * @return the size of this collection\r
+     */\r
+    public int getObjRefCount(\r
+    ) {\r
+        return this._objRef.size();\r
+    }\r
+\r
+    /**\r
      * Overrides the java.lang.Object.hashCode method.\r
      * <p>\r
      * The following steps came from <b>Effective Java Programming\r
@@ -183,6 +265,37 @@ implements java.io.Serializable
     }\r
 \r
     /**\r
+     */\r
+    public void removeAllObjRef(\r
+    ) {\r
+        this._objRef.clear();\r
+    }\r
+\r
+    /**\r
+     * Method removeObjRef.\r
+     * \r
+     * @param vObjRef\r
+     * @return true if the object was removed from the collection.\r
+     */\r
+    public boolean removeObjRef(\r
+            final java.lang.Object vObjRef) {\r
+        boolean removed = _objRef.remove(vObjRef);\r
+        return removed;\r
+    }\r
+\r
+    /**\r
+     * Method removeObjRefAt.\r
+     * \r
+     * @param index\r
+     * @return the element removed from the collection\r
+     */\r
+    public java.lang.Object removeObjRefAt(\r
+            final int index) {\r
+        java.lang.Object obj = this._objRef.remove(index);\r
+        return obj;\r
+    }\r
+\r
+    /**\r
      * Sets the value of field 'name'.\r
      * \r
      * @param name the value of field 'name'.\r
@@ -193,16 +306,64 @@ implements java.io.Serializable
     }\r
 \r
     /**\r
-     * Sets the value of field 'objRef'. The field 'objRef' has the\r
-     * following description: Reference Frame for rangeType\r
-     * specfication\r
-     *  \r
      * \r
-     * @param objRef the value of field 'objRef'.\r
+     * \r
+     * @param index\r
+     * @param vObjRef\r
+     * @throws java.lang.IndexOutOfBoundsException if the index\r
+     * given is outside the bounds of the collection\r
      */\r
     public void setObjRef(\r
-            final java.lang.Object objRef) {\r
-        this._objRef = objRef;\r
+            final int index,\r
+            final java.lang.Object vObjRef)\r
+    throws java.lang.IndexOutOfBoundsException {\r
+        // check bounds for index\r
+        if (index < 0 || index >= this._objRef.size()) {\r
+            throw new IndexOutOfBoundsException("setObjRef: Index value '" + index + "' not in range [0.." + (this._objRef.size() - 1) + "]");\r
+        }\r
+        \r
+        this._objRef.set(index, vObjRef);\r
+    }\r
+\r
+    /**\r
+     * \r
+     * \r
+     * @param vObjRefArray\r
+     */\r
+    public void setObjRef(\r
+            final java.lang.Object[] vObjRefArray) {\r
+        //-- copy array\r
+        _objRef.clear();\r
+        \r
+        for (int i = 0; i < vObjRefArray.length; i++) {\r
+                this._objRef.add(vObjRefArray[i]);\r
+        }\r
+    }\r
+\r
+    /**\r
+     * Sets the value of '_objRef' by copying the given Vector. All\r
+     * elements will be checked for type safety.\r
+     * \r
+     * @param vObjRefList the Vector to copy.\r
+     */\r
+    public void setObjRef(\r
+            final java.util.Vector vObjRefList) {\r
+        // copy vector\r
+        this._objRef.clear();\r
+        \r
+        this._objRef.addAll(vObjRefList);\r
+    }\r
+\r
+    /**\r
+     * Sets the value of '_objRef' by setting it to the given\r
+     * Vector. No type checking is performed.\r
+     * @deprecated\r
+     * \r
+     * @param objRefVector the Vector to set.\r
+     */\r
+    public void setObjRefAsReference(\r
+            final java.util.Vector objRefVector) {\r
+        this._objRef = objRefVector;\r
     }\r
 \r
     /**\r