JAL-1767 scheme DoubleMatrix type includes D and E vectors (optional)
[jalview.git] / src / jalview / schemabinding / version2 / DoubleVector.java
index 75597ab..c4d8ff5 100644 (file)
@@ -27,9 +27,9 @@ public class DoubleVector implements java.io.Serializable
   // --------------------------/
 
   /**
-   * Field _dList.
+   * Field _vList.
    */
-  private java.util.Vector _dList;
+  private java.util.Vector _vList;
 
   // ----------------/
   // - Constructors -/
@@ -38,7 +38,7 @@ public class DoubleVector implements java.io.Serializable
   public DoubleVector()
   {
     super();
-    this._dList = new java.util.Vector();
+    this._vList = new java.util.Vector();
   }
 
   // -----------/
@@ -48,71 +48,71 @@ public class DoubleVector implements java.io.Serializable
   /**
    * 
    * 
-   * @param vD
+   * @param vV
    * @throws java.lang.IndexOutOfBoundsException
    *           if the index given is outside the bounds of the collection
    */
-  public void addD(final double vD)
+  public void addV(final double vV)
           throws java.lang.IndexOutOfBoundsException
   {
-    this._dList.addElement(new java.lang.Double(vD));
+    this._vList.addElement(new java.lang.Double(vV));
   }
 
   /**
    * 
    * 
    * @param index
-   * @param vD
+   * @param vV
    * @throws java.lang.IndexOutOfBoundsException
    *           if the index given is outside the bounds of the collection
    */
-  public void addD(final int index, final double vD)
+  public void addV(final int index, final double vV)
           throws java.lang.IndexOutOfBoundsException
   {
-    this._dList.add(index, new java.lang.Double(vD));
+    this._vList.add(index, new java.lang.Double(vV));
   }
 
   /**
-   * Method enumerateD.
+   * Method enumerateV.
    * 
    * @return an Enumeration over all double elements
    */
-  public java.util.Enumeration enumerateD()
+  public java.util.Enumeration enumerateV()
   {
-    return this._dList.elements();
+    return this._vList.elements();
   }
 
   /**
-   * Method getD.
+   * Method getV.
    * 
    * @param index
    * @throws java.lang.IndexOutOfBoundsException
    *           if the index given is outside the bounds of the collection
    * @return the value of the double at the given index
    */
-  public double getD(final int index)
+  public double getV(final int index)
           throws java.lang.IndexOutOfBoundsException
   {
     // check bounds for index
-    if (index < 0 || index >= this._dList.size())
+    if (index < 0 || index >= this._vList.size())
     {
-      throw new IndexOutOfBoundsException("getD: Index value '" + index
-              + "' not in range [0.." + (this._dList.size() - 1) + "]");
+      throw new IndexOutOfBoundsException("getV: Index value '" + index
+              + "' not in range [0.." + (this._vList.size() - 1) + "]");
     }
 
-    return ((java.lang.Double) _dList.get(index)).doubleValue();
+    return ((java.lang.Double) _vList.get(index)).doubleValue();
   }
 
   /**
-   * Method getD.Returns the contents of the collection in an Array.
+   * Method getV.Returns the contents of the collection in an Array.
    * 
    * @return this collection as an Array
    */
-  public double[] getD()
+  public double[] getV()
   {
-    int size = this._dList.size();
+    int size = this._vList.size();
     double[] array = new double[size];
-    java.util.Iterator iter = _dList.iterator();
+    java.util.Iterator iter = _vList.iterator();
     for (int index = 0; index < size; index++)
     {
       array[index] = ((java.lang.Double) iter.next()).doubleValue();
@@ -121,13 +121,13 @@ public class DoubleVector implements java.io.Serializable
   }
 
   /**
-   * Method getDCount.
+   * Method getVCount.
    * 
    * @return the size of this collection
    */
-  public int getDCount()
+  public int getVCount()
   {
-    return this._dList.size();
+    return this._vList.size();
   }
 
   /**
@@ -186,32 +186,32 @@ public class DoubleVector implements java.io.Serializable
 
   /**
    */
-  public void removeAllD()
+  public void removeAllV()
   {
-    this._dList.clear();
+    this._vList.clear();
   }
 
   /**
-   * Method removeD.
+   * Method removeV.
    * 
-   * @param vD
+   * @param vV
    * @return true if the object was removed from the collection.
    */
-  public boolean removeD(final double vD)
+  public boolean removeV(final double vV)
   {
-    boolean removed = _dList.remove(new java.lang.Double(vD));
+    boolean removed = _vList.remove(new java.lang.Double(vV));
     return removed;
   }
 
   /**
-   * Method removeDAt.
+   * Method removeVAt.
    * 
    * @param index
    * @return the element removed from the collection
    */
-  public double removeDAt(final int index)
+  public double removeVAt(final int index)
   {
-    java.lang.Object obj = this._dList.remove(index);
+    java.lang.Object obj = this._vList.remove(index);
     return ((java.lang.Double) obj).doubleValue();
   }
 
@@ -219,36 +219,36 @@ public class DoubleVector implements java.io.Serializable
    * 
    * 
    * @param index
-   * @param vD
+   * @param vV
    * @throws java.lang.IndexOutOfBoundsException
    *           if the index given is outside the bounds of the collection
    */
-  public void setD(final int index, final double vD)
+  public void setV(final int index, final double vV)
           throws java.lang.IndexOutOfBoundsException
   {
     // check bounds for index
-    if (index < 0 || index >= this._dList.size())
+    if (index < 0 || index >= this._vList.size())
     {
-      throw new IndexOutOfBoundsException("setD: Index value '" + index
-              + "' not in range [0.." + (this._dList.size() - 1) + "]");
+      throw new IndexOutOfBoundsException("setV: Index value '" + index
+              + "' not in range [0.." + (this._vList.size() - 1) + "]");
     }
 
-    this._dList.set(index, new java.lang.Double(vD));
+    this._vList.set(index, new java.lang.Double(vV));
   }
 
   /**
    * 
    * 
-   * @param vDArray
+   * @param vVArray
    */
-  public void setD(final double[] vDArray)
+  public void setV(final double[] vVArray)
   {
     // -- copy array
-    _dList.clear();
+    _vList.clear();
 
-    for (int i = 0; i < vDArray.length; i++)
+    for (int i = 0; i < vVArray.length; i++)
     {
-      this._dList.add(new java.lang.Double(vDArray[i]));
+      this._vList.add(new java.lang.Double(vVArray[i]));
     }
   }