Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / src / javajs / util / T4.java
index 80a4afe..1309fa3 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
-/**\r
- * A generic 4 element tuple that is represented by single precision floating\r
- * point x,y,z and w coordinates.\r
- * \r
- * @version specification 1.1, 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\r
- * for unique constructor and method names\r
- * for the optimization of compiled JavaScript using Java2Script\r
- */\r
-public abstract class T4 extends T3 {\r
-\r
-  /**\r
-   * The w coordinate.\r
-   */\r
-  public float w;\r
-\r
-  /**\r
-   * Constructs and initializes a Tuple4f to (0,0,0,0).\r
-   * \r
-   * @j2sIgnore   * \r
-   */\r
-  public T4() {\r
-  }\r
-\r
-  /**\r
-   * Sets the value of this tuple to the specified xyzw coordinates.\r
-   * \r
-   * @param x\r
-   *        the x coordinate\r
-   * @param y\r
-   *        the y coordinate\r
-   * @param z\r
-   *        the z coordinate\r
-   * @param w\r
-   *        the w coordinate\r
-   */\r
-  public final void set4(float x, float y, float z, float w) {\r
-    this.x = x;\r
-    this.y = y;\r
-    this.z = z;\r
-    this.w = w;\r
-  }\r
-\r
-  /**\r
-   * Sets the value of this tuple to the scalar multiplication of itself.\r
-   * \r
-   * @param s\r
-   *        the scalar value\r
-   */\r
-  public final void scale4(float s) {\r
-    scale(s);\r
-    w *= s;\r
-  }\r
-\r
-  /**\r
-   * Returns a hash number based on the data values in this object. Two\r
-   * different Tuple4f objects with identical data values (ie, returns true for\r
-   * equals(Tuple4f) ) 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 floatToIntBits0(x) ^ floatToIntBits0(y)\r
-        ^ floatToIntBits0(z) ^ floatToIntBits0(w);\r
-  }\r
-\r
-  /**\r
-   * Returns true if all of the data members of Object are equal to the\r
-   * corresponding data members in this\r
-   * \r
-   * @param o\r
-   *        the vector with which the comparison is made.\r
-   */\r
-  @Override\r
-  public boolean equals(Object o) {\r
-    if (!(o instanceof T4))\r
-      return false;\r
-    T4 t = (T4) o;\r
-    return (this.x == t.x && this.y == t.y && this.z == t.z && this.w == t.w);\r
-  }\r
-\r
-  /**\r
-   * Returns a string that contains the values of this Tuple4f. The form is\r
-   * (x,y,z,w).\r
-   * \r
-   * @return the String representation\r
-   */\r
-  @Override\r
-  public String toString() {\r
-    return "(" + x + ", " + y + ", " + z + ", " + w + ")";\r
-  }\r
-\r
-  @Override\r
-  public String toJSON() {\r
-    return "[" + x + ", " + y + ", " + z + ", " + w + "]";\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;
+
+/**
+ * A generic 4 element tuple that is represented by single precision floating
+ * point x,y,z and w coordinates.
+ * 
+ * @version specification 1.1, 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 T4 extends T3 {
+
+  /**
+   * The w coordinate.
+   */
+  public float w;
+
+  /**
+   * Constructs and initializes a Tuple4f to (0,0,0,0).
+   * 
+   * @j2sIgnore   * 
+   */
+  public T4() {
+  }
+
+  /**
+   * Sets the value of this tuple to the specified xyzw coordinates.
+   * 
+   * @param x
+   *        the x coordinate
+   * @param y
+   *        the y coordinate
+   * @param z
+   *        the z coordinate
+   * @param w
+   *        the w coordinate
+   */
+  public final void set4(float x, float y, float z, float w) {
+    this.x = x;
+    this.y = y;
+    this.z = z;
+    this.w = w;
+  }
+
+  /**
+   * Sets the value of this tuple to the scalar multiplication of itself.
+   * 
+   * @param s
+   *        the scalar value
+   */
+  public final void scale4(float s) {
+    scale(s);
+    w *= s;
+  }
+
+  /**
+   * Returns a hash number based on the data values in this object. Two
+   * different Tuple4f objects with identical data values (ie, returns true for
+   * equals(Tuple4f) ) 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 floatToIntBits0(x) ^ floatToIntBits0(y)
+        ^ floatToIntBits0(z) ^ floatToIntBits0(w);
+  }
+
+  /**
+   * Returns true if all of the data members of Object are equal to the
+   * corresponding data members in this
+   * 
+   * @param o
+   *        the vector with which the comparison is made.
+   */
+  @Override
+  public boolean equals(Object o) {
+    if (!(o instanceof T4))
+      return false;
+    T4 t = (T4) o;
+    return (this.x == t.x && this.y == t.y && this.z == t.z && this.w == t.w);
+  }
+
+  /**
+   * Returns a string that contains the values of this Tuple4f. The form is
+   * (x,y,z,w).
+   * 
+   * @return the String representation
+   */
+  @Override
+  public String toString() {
+    return "(" + x + ", " + y + ", " + z + ", " + w + ")";
+  }
+
+  @Override
+  public String toJSON() {
+    return "[" + x + ", " + y + ", " + z + ", " + w + "]";
+  }
+
+}