public class DoubleHashingTable extends ProbingHashTable { private static final int CAPACITY = 1; private static final double LOADFACTOR = 0.5; public DoubleHashingTable(int capacity, double loadFactor) { super(capacity, loadFactor); } public DoubleHashingTable(double loadFactor) { super(CAPACITY, loadFactor); } public DoubleHashingTable(int capacity) { super(capacity, LOADFACTOR); } public DoubleHashingTable() { super(CAPACITY, LOADFACTOR); } protected final int findIndex(Object key) { int code = key.hashCode() & Integer.MAX_VALUE; int length = table.length; int index = code % length; int probe = 1 + (code % (length - 1)); super.nrProbes = 1; while (table[index] != null && !(table[index].key.equals(key))) { index += probe; if (index >= length) { index -= length; } ++super.nrProbes; } return index; } }