Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / src / javajs / util / T3i.java
index cbd4a2c..7fbd3bb 100644 (file)
-/*\r
-   Copyright (C) 1997,1998,1999\r
-   Kenji Hiranabe, Eiwa System Management, Inc.\r
-\r
-   This program is free software.\r
-   Implemented by Kenji Hiranabe(hiranabe@esm.co.jp),\r
-   conforming to the Java(TM) 3D API specification by Sun Microsystems.\r
-\r
-   Permission to use, copy, modify, distribute and sell this software\r
-   and its documentation for any purpose is hereby granted without fee,\r
-   provided that the above copyright notice appear in all copies and\r
-   that both that copyright notice and this permission notice appear\r
-   in supporting documentation. Kenji Hiranabe and Eiwa System Management,Inc.\r
-   makes no representations about the suitability of this software for any\r
-   purpose.  It is provided "AS IS" with NO WARRANTY.\r
-*/\r
-package javajs.util;\r
-\r
-import java.io.Serializable;\r
-\r
-/**\r
- * A 3-element tuple represented by signed integer x,y,z coordinates.\r
- * \r
- * @since Java 3D 1.2\r
- * @version specification 1.2, implementation $Revision: 1.9 $, $Date:\r
- *          2006/07/28 17:01:32 $\r
- * @author Kenji hiranabe\r
- * \r
- *         additions by Bob Hanson hansonr@stolaf.edu 9/30/2012 for unique\r
- *         constructor and method names for the optimization of compiled\r
- *         JavaScript using Java2Script\r
- */\r
-public abstract class T3i implements Serializable {\r
-\r
-  /**\r
-   * The x coordinate.\r
-   */\r
-  public int x;\r
-\r
-  /**\r
-   * The y coordinate.\r
-   */\r
-  public int y;\r
-\r
-  /**\r
-   * The z coordinate.\r
-   */\r
-  public int z;\r
-\r
-  /**\r
-   * Constructs and initializes a Tuple3i to (0,0,0).\r
-   */\r
-  public T3i() {\r
-  }\r
-\r
-  /**\r
-   * Sets the value of this tuple to to the specified x, y, and z coordinates.\r
-   * \r
-   * @param x\r
-   *        the x coordinate.\r
-   * @param y\r
-   *        the y coordinate.\r
-   * @param z\r
-   *        the z coordinate.\r
-   */\r
-  public final void set(int x, int y, int z) {\r
-    this.x = x;\r
-    this.y = y;\r
-    this.z = z;\r
-  }\r
-\r
-  /**\r
-   * Sets the value of this tuple to the value of tuple t1.\r
-   * \r
-   * @param t1\r
-   *        the tuple to be copied.\r
-   */\r
-  public final void setT(T3i t1) {\r
-    x = t1.x;\r
-    y = t1.y;\r
-    z = t1.z;\r
-  }\r
-\r
-  /**\r
-   * Sets the value of this tuple to the sum of itself and t1.\r
-   * \r
-   * @param t\r
-   *        is the other tuple\r
-   */\r
-  public final void add(T3i t) {\r
-    x += t.x;\r
-    y += t.y;\r
-    z += t.z;\r
-  }\r
-\r
-  /**\r
-   * Sets the value of this tuple to the scalar multiplication of tuple t1 plus\r
-   * tuple t2 (this = s*t1 + t2).\r
-   * \r
-   * @param s\r
-   *        the scalar value\r
-   * @param t1\r
-   *        the tuple to be multipled\r
-   * @param t2\r
-   *        the tuple to be added\r
-   */\r
-  public final void scaleAdd(int s, T3i t1, T3i t2) {\r
-    x = s * t1.x + t2.x;\r
-    y = s * t1.y + t2.y;\r
-    z = s * t1.z + t2.z;\r
-  }\r
-\r
-  /**\r
-   * Returns a hash number based on the data values in this object. Two\r
-   * different Tuple3i objects with identical data values (ie, returns true for\r
-   * equals(Tuple3i) ) will return the same hash number. Two vectors with\r
-   * different data members may return the same hash value, although this is not\r
-   * likely.\r
-   */\r
-  @Override\r
-  public int hashCode() {\r
-    return x ^ y ^ z;\r
-  }\r
-\r
-  /**\r
-   * Returns true if the Object o is of type Tuple3i and all of the data members\r
-   * of t are equal to the corresponding data members in this Tuple3i.\r
-   * \r
-   * @param o\r
-   *        the object with which the comparison is made.\r
-   */\r
-  @Override\r
-  public boolean equals(Object o) {\r
-    if (!(o instanceof T3i))\r
-      return false;\r
-    T3i t = (T3i) o;\r
-    return (this.x == t.x && this.y == t.y && this.z == t.z);\r
-  }\r
-\r
-  /**\r
-   * Returns a string that contains the values of this Tuple3i. The form is\r
-   * (x,y,z).\r
-   * \r
-   * @return the String representation\r
-   */\r
-  @Override\r
-  public String toString() {\r
-    return "(" + x + ", " + y + ", " + z + ")";\r
-  }\r
-\r
-}\r
+/*
+   Copyright (C) 1997,1998,1999
+   Kenji Hiranabe, Eiwa System Management, Inc.
+
+   This program is free software.
+   Implemented by Kenji Hiranabe(hiranabe@esm.co.jp),
+   conforming to the Java(TM) 3D API specification by Sun Microsystems.
+
+   Permission to use, copy, modify, distribute and sell this software
+   and its documentation for any purpose is hereby granted without fee,
+   provided that the above copyright notice appear in all copies and
+   that both that copyright notice and this permission notice appear
+   in supporting documentation. Kenji Hiranabe and Eiwa System Management,Inc.
+   makes no representations about the suitability of this software for any
+   purpose.  It is provided "AS IS" with NO WARRANTY.
+*/
+package javajs.util;
+
+import java.io.Serializable;
+
+/**
+ * A 3-element tuple represented by signed integer x,y,z coordinates.
+ * 
+ * @since Java 3D 1.2
+ * @version specification 1.2, implementation $Revision: 1.9 $, $Date:
+ *          2006/07/28 17:01:32 $
+ * @author Kenji hiranabe
+ * 
+ *         additions by Bob Hanson hansonr@stolaf.edu 9/30/2012 for unique
+ *         constructor and method names for the optimization of compiled
+ *         JavaScript using Java2Script
+ */
+public abstract class T3i implements Serializable {
+
+  /**
+   * The x coordinate.
+   */
+  public int x;
+
+  /**
+   * The y coordinate.
+   */
+  public int y;
+
+  /**
+   * The z coordinate.
+   */
+  public int z;
+
+  /**
+   * Constructs and initializes a Tuple3i to (0,0,0).
+   */
+  public T3i() {
+  }
+
+  /**
+   * Sets the value of this tuple to to the specified x, y, and z coordinates.
+   * 
+   * @param x
+   *        the x coordinate.
+   * @param y
+   *        the y coordinate.
+   * @param z
+   *        the z coordinate.
+   */
+  public final void set(int x, int y, int z) {
+    this.x = x;
+    this.y = y;
+    this.z = z;
+  }
+
+  /**
+   * Sets the value of this tuple to the value of tuple t1.
+   * 
+   * @param t1
+   *        the tuple to be copied.
+   */
+  public final void setT(T3i t1) {
+    x = t1.x;
+    y = t1.y;
+    z = t1.z;
+  }
+
+  /**
+   * Sets the value of this tuple to the sum of itself and t1.
+   * 
+   * @param t
+   *        is the other tuple
+   */
+  public final void add(T3i t) {
+    x += t.x;
+    y += t.y;
+    z += t.z;
+  }
+
+  /**
+   * Sets the value of this tuple to the scalar multiplication of tuple t1 plus
+   * tuple t2 (this = s*t1 + t2).
+   * 
+   * @param s
+   *        the scalar value
+   * @param t1
+   *        the tuple to be multipled
+   * @param t2
+   *        the tuple to be added
+   */
+  public final void scaleAdd(int s, T3i t1, T3i t2) {
+    x = s * t1.x + t2.x;
+    y = s * t1.y + t2.y;
+    z = s * t1.z + t2.z;
+  }
+
+  /**
+   * Returns a hash number based on the data values in this object. Two
+   * different Tuple3i objects with identical data values (ie, returns true for
+   * equals(Tuple3i) ) will return the same hash number. Two vectors with
+   * different data members may return the same hash value, although this is not
+   * likely.
+   */
+  @Override
+  public int hashCode() {
+    return x ^ y ^ z;
+  }
+
+  /**
+   * Returns true if the Object o is of type Tuple3i and all of the data members
+   * of t are equal to the corresponding data members in this Tuple3i.
+   * 
+   * @param o
+   *        the object with which the comparison is made.
+   */
+  @Override
+  public boolean equals(Object o) {
+    if (!(o instanceof T3i))
+      return false;
+    T3i t = (T3i) o;
+    return (this.x == t.x && this.y == t.y && this.z == t.z);
+  }
+
+  /**
+   * Returns a string that contains the values of this Tuple3i. The form is
+   * (x,y,z).
+   * 
+   * @return the String representation
+   */
+  @Override
+  public String toString() {
+    return "(" + x + ", " + y + ", " + z + ")";
+  }
+
+}