Java Arrays.deepHashCode Examples

Java Arrays.deepHashCode - 30 examples found. These are the top rated real world Java examples of java.util.Arrays.deepHashCode extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
 @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;
 }
Example #2
0
 @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;
 }
Example #3
0
 @Override
 public int hashCode() {
   int hash = 5;
   hash = 41 * hash + this.number;
   hash = 41 * hash + Arrays.deepHashCode(this.board);
   return hash;
 }
Example #4
0
  /**
   * 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);
  }
Example #5
0
 @Override
 public int hashCode() {
   int hash = 5;
   hash = 67 * hash + Arrays.deepHashCode(this.views);
   hash = 67 * hash + this.length;
   return hash;
 }
Example #6
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + Arrays.deepHashCode(matrix);
   return result;
 }