コード例 #1
0
ファイル: Tuple3f.java プロジェクト: lubosz/R22D
 /**
  * Returns a hash code value based on the data values in this object. Two different Tuple3f
  * objects with identical data values (i.e., Tuple3f.equals returns true) will return the same
  * hash code value. Two objects with different data members may return the same hash value,
  * although this is not likely.
  *
  * @return the integer hash code value
  */
 public int hashCode() {
   long bits = 1L;
   bits = 31L * bits + (long) VecMathUtil.floatToIntBits(x);
   bits = 31L * bits + (long) VecMathUtil.floatToIntBits(y);
   bits = 31L * bits + (long) VecMathUtil.floatToIntBits(z);
   return (int) (bits ^ (bits >> 32));
 }
コード例 #2
0
ファイル: Tuple4d.java プロジェクト: miho/vecmath
 /**
  * Returns a hash code value based on the data values in this object. Two different Tuple4d
  * objects with identical data values (i.e., Tuple4d.equals returns true) will return the same
  * hash code value. Two objects with different data members may return the same hash value,
  * although this is not likely.
  *
  * @return the integer hash code value
  */
 public int hashCode() {
   long bits = 1L;
   bits = 31L * bits + VecMathUtil.doubleToLongBits(x);
   bits = 31L * bits + VecMathUtil.doubleToLongBits(y);
   bits = 31L * bits + VecMathUtil.doubleToLongBits(z);
   bits = 31L * bits + VecMathUtil.doubleToLongBits(w);
   return (int) (bits ^ (bits >> 32));
 }
コード例 #3
0
ファイル: AxisAngle4d.java プロジェクト: gouessej/vecmath
 /**
  * Returns a hash code value based on the data values in this object. Two different AxisAngle4d
  * objects with identical data values (i.e., AxisAngle4d.equals returns true) will return the same
  * hash code value. Two objects with different data members may return the same hash value,
  * although this is not likely.
  *
  * @return the integer hash code value
  */
 @Override
 public int hashCode() {
   long bits = 1L;
   bits = VecMathUtil.hashDoubleBits(bits, x);
   bits = VecMathUtil.hashDoubleBits(bits, y);
   bits = VecMathUtil.hashDoubleBits(bits, z);
   bits = VecMathUtil.hashDoubleBits(bits, angle);
   return VecMathUtil.hashFinish(bits);
 }
コード例 #4
0
  /**
   * Returns a hash code value based on the data values in this object. Two different GVector
   * objects with identical data values (i.e., GVector.equals returns true) will return the same
   * hash number. Two GVector objects with different data members may return the same hash value,
   * although this is not likely.
   *
   * @return the integer hash code value
   */
  public int hashCode() {
    long bits = 1L;

    for (int i = 0; i < length; i++) {
      bits = 31L * bits + VecMathUtil.doubleToLongBits(values[i]);
    }

    return (int) (bits ^ (bits >> 32));
  }