Beispiel #1
0
  /** {@inheritDoc} */
  @Override
  public int hashCode() {
    int h = 0;

    // allocated default key has hash = 0

    final KType[] keys = Intrinsics.<KType[]>cast(this.keys);

    for (int i = keys.length; --i >= 0; ) {
      KType existing;
      if (!Intrinsics.<KType>isEmpty(existing = keys[i])) {
        h += BitMixer.mix(existing);
      }
    }

    return h;
  }
Beispiel #2
0
  /**
   * REHASH2 method for rehashing the keys with perturbation seed as parameter (inlined in generated
   * code) Thanks to single array mode, no need to check for null/0 or booleans.
   */
  private int REHASH2(final KType value, final int perturb) {

    return BitMixer.mix(hashKey(value), perturb);
  }
Beispiel #3
0
  /**
   * REHASH method for rehashing the keys. (inlined in generated code) Thanks to single array mode,
   * no need to check for null/0 or booleans.
   */
  private int REHASH(final KType value) {

    return BitMixer.mix(hashKey(value), this.perturbation);
  }