Beispiel #1
1
 @Override
 public int hashCode() {
   int hash = 7;
   hash = 11 * hash + Arrays.deepHashCode(this.inputs);
   hash = 11 * hash + Arrays.deepHashCode(this.outputs);
   hash = 11 * hash + Arrays.deepHashCode(this.defaults);
   hash = 11 * hash + (this.type != null ? this.type.hashCode() : 0);
   hash = 11 * hash + (this.properties != null ? this.properties.hashCode() : 0);
   return hash;
 }
Beispiel #2
1
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((requestReplyId == null) ? 0 : requestReplyId.hashCode());
   result = prime * result + ((methodName == null) ? 0 : methodName.hashCode());
   result = prime * result + ((params == null) ? 0 : Arrays.deepHashCode(params));
   result = prime * result + ((paramDatatypes == null) ? 0 : Arrays.deepHashCode(paramDatatypes));
   return result;
 }
Beispiel #3
1
 @Override
 public int hashCode() {
   int hash = 5;
   hash = 41 * hash + this.number;
   hash = 41 * hash + Arrays.deepHashCode(this.board);
   return hash;
 }
Beispiel #4
1
  /**
   * Constructor which uses the previous GameTurn to be able to record the new state based on the
   * previous one, And applying the potential modifications: adding the played stone, and removing
   * and counting captured stones. Cam also make a passing move by setting the coordinates of the
   * played stone to (-1,-1).
   *
   * @param prev The previous GameTurn.
   * @param X The x coordinate of the played stone, this game turn, -1 if the player passes.
   * @param Y The y coordinate of the played stone, this game turn, -1 if the player passes.
   * @param playerId The id of the player making the given game turn.
   * @param freedIntersections A set of Intersections which may have been freed, due to being
   *     captured.
   */
  private GameTurn(
      GameTurn prev,
      int X,
      int Y,
      int playerId,
      int handicap,
      Set<Intersection> freedIntersections) {
    int width = prev.gobanState.length;
    int height = prev.gobanState[0].length;

    gobanState = new int[width][height];
    for (int i = 0; i < width; i++) {
      gobanState[i] = prev.gobanState[i].clone();
    }
    x = X;
    y = Y;

    // Applying the played stone change, if is not a pass move
    if (x >= 0 && y >= 0) {
      gobanState[x][y] = playerId;
      passCount = 0;
    } else {
      passCount = prev.passCount + 1;
    }

    // Setting all the freed intersections to 0, and counting the number of captured stones
    for (Intersection freedIntersection : freedIntersections) {
      gobanState[freedIntersection.getX()][freedIntersection.getY()] = 0;
    }
    countCapturedStones = freedIntersections.size();
    ;

    // Using Java Tools to make a pertinent hash on the goban state
    hashCode = Arrays.deepHashCode(gobanState);
  }
 @Override
 public int hashCode() {
   int hash = 5;
   hash = 67 * hash + Arrays.deepHashCode(this.views);
   hash = 67 * hash + this.length;
   return hash;
 }
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + Arrays.deepHashCode(matrix);
   return result;
 }
Beispiel #7
1
 @Override
 public int hashCode() {
   return System.identityHashCode(type)
       + Arrays.deepHashCode(elements)
       + (enumConstant != null ? enumConstant.hashCode() : 0)
       + (values != null ? values.hashCode() : 0)
       + (superObject != null ? superObject.hashCode() : 0);
 }
 @Override
 public int hashCode() {
   int hash = 7;
   hash = 29 * hash + this.n;
   hash = 29 * hash + Arrays.deepHashCode(this.layout);
   hash = 29 * hash + Objects.hashCode(this.emptySpace);
   return hash;
 }
Beispiel #9
1
  @Override
  public int hashCode() {
    int hash = 7;
    hash = 59 * hash + Arrays.deepHashCode(this.board);
    hash = 59 * hash + this.horizontal_size;
    hash = 59 * hash + this.vertical_size;

    return hash;
  }
Beispiel #10
1
 /* (non-Javadoc)
  * @see java.lang.Object#hashCode()
  */
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((indexFieldMap == null) ? 0 : indexFieldMap.hashCode());
   result =
       prime * result + ((sensorParams == null) ? 0 : Arrays.deepHashCode(sensorParams.keys()));
   return result;
 }
Beispiel #11
1
 @Override
 public int hashCode() {
   final Object key = this._key();
   if (key == null) {
     return 0;
   }
   if (key.getClass().isArray()) {
     return Arrays.deepHashCode((Object[]) key);
   }
   return key.hashCode();
 }
Beispiel #12
1
  /**
   * Constructor for the first virtual gameTurn, which gives the correct size for the array
   * representing the goban.
   *
   * @param width width of the corresponding goban.
   * @param height height of the corresponding goban.
   */
  public GameTurn(int width, int height) {
    gobanState = new int[width][height];
    countCapturedStones = 0;
    passCount = 0;

    // Move is virtual, x and y are set to -1
    x = -1;
    y = -1;

    // Using Java Tools to make a pertinent hash on the goban state
    hashCode = Arrays.deepHashCode(gobanState);
  }
 @Override
 public int hashCode() {
   int result = super.hashCode();
   long temp;
   result = 31 * result + Arrays.hashCode(a1);
   result = 31 * result + Arrays.deepHashCode(a2);
   result = 31 * result + Arrays.hashCode(a3);
   result = 31 * result + Arrays.deepHashCode(a4);
   result = 31 * result + Arrays.hashCode(a5);
   result = 31 * result + Arrays.deepHashCode(a6);
   result = 31 * result + (int) a7;
   result = 31 * result + (int) a8;
   result = 31 * result + a9;
   result = 31 * result + (int) (a10 ^ (a10 >>> 32));
   result = 31 * result + (a11 != +0.0f ? Float.floatToIntBits(a11) : 0);
   temp = Double.doubleToLongBits(a12);
   result = 31 * result + (int) (temp ^ (temp >>> 32));
   result = 31 * result + a13.hashCode();
   result = 31 * result + a14.hashCode();
   return result;
 }
 @java.lang.Override
 @java.lang.SuppressWarnings("all")
 public int hashCode() {
   final int PRIME = 59;
   int result = 1;
   result = result * PRIME + this.x;
   result = result * PRIME + java.util.Arrays.hashCode(this.y);
   result = result * PRIME + java.util.Arrays.deepHashCode(this.z);
   final java.lang.Object $a = this.a;
   result = result * PRIME + ($a == null ? 0 : $a.hashCode());
   final java.lang.Object $b = this.b;
   result = result * PRIME + ($b == null ? 0 : $b.hashCode());
   return result;
 }
Beispiel #15
1
 /**
  * Gets hash code of an object, optionally returns hash code based on the "deep contents" of array
  * if the object is an array.
  *
  * <p>If {@code o} is null, 0 is returned; if {@code o} is an array, the corresponding {@link
  * Arrays#deepHashCode(Object[])}, or {@link Arrays#hashCode(int[])} or the like is used to
  * calculate the hash code.
  */
 public static int deepHashCode(@Nullable Object o) {
   if (o == null) {
     return 0;
   }
   if (!o.getClass().isArray()) {
     return o.hashCode();
   }
   if (o instanceof Object[]) {
     return Arrays.deepHashCode((Object[]) o);
   }
   if (o instanceof boolean[]) {
     return Arrays.hashCode((boolean[]) o);
   }
   if (o instanceof char[]) {
     return Arrays.hashCode((char[]) o);
   }
   if (o instanceof byte[]) {
     return Arrays.hashCode((byte[]) o);
   }
   if (o instanceof short[]) {
     return Arrays.hashCode((short[]) o);
   }
   if (o instanceof int[]) {
     return Arrays.hashCode((int[]) o);
   }
   if (o instanceof long[]) {
     return Arrays.hashCode((long[]) o);
   }
   if (o instanceof float[]) {
     return Arrays.hashCode((float[]) o);
   }
   if (o instanceof double[]) {
     return Arrays.hashCode((double[]) o);
   }
   throw new AssertionError();
 }
Beispiel #16
1
 @Override
 public int hashCode() {
   int hash = 3;
   hash = 13 * hash + Arrays.deepHashCode(this.components);
   return hash;
 }
Beispiel #17
1
 @Override
 public int hashCode() {
   return Arrays.deepHashCode(values);
 }
Beispiel #18
1
 @Override
 public final int hashCode() {
   return HASHMULT * HASHBASE + Arrays.deepHashCode(this.edges);
 }
 @Override
 public int hashCode() {
   int hc = _viewDefinitionId.hashCode();
   hc += (hc << 4) + Arrays.deepHashCode(_marketDataProvider);
   return hc;
 }
 @Override
 public int hashCode() {
   int hash = 3;
   hash = 31 * hash + Arrays.deepHashCode(this.dungeonInventory);
   return hash;
 }
Beispiel #21
1
 @Override
 public int hashCode() {
   return Arrays.deepHashCode(go) + Arrays.deepHashCode(action);
 }
 @Override
 public int hashCode() {
   int result = total_count != null ? total_count.hashCode() : 0;
   result = 31 * result + Arrays.deepHashCode(photos);
   return result;
 }
 @Override
 public int hashCode() {
   return Arrays.deepHashCode(toArray());
 }
 public int hashCode(final boolean[][] o) {
   return java.util.Arrays.deepHashCode(o);
 }
Beispiel #25
1
 public static @infix @inline <T> int deepHashCode(T[] array) {
   return Arrays.deepHashCode(array);
 }
 @Override
 public int hashCode() {
   return Objects.hash(statement, Arrays.deepHashCode(parameters));
 }
 @Override
 public int hashCode() {
   return Arrays.deepHashCode(new Object[] {cfId, partitionKey, cellName});
 }
Beispiel #28
0
 @Override
 public int hashCode() {
   int hash = 3;
   hash = 97 * hash + Arrays.deepHashCode(this.e);
   return hash;
 }
 @Override
 public int hashCode() {
   int hash = 7;
   hash = 73 * hash + Arrays.deepHashCode(this.tbl);
   return hash;
 }
 @Override
 public int hashCode() {
   return this.types.hashCode() ^ Arrays.deepHashCode(this.types);
 }