/** * Increases the capacity of and internally reorganizes this * SymbolTable, in order to accommodate and access its entries more * efficiently. This method is called automatically when the * number of keys in the SymbolTable exceeds this hashtable's capacity * and load factor. */ protected void rehash() { rehashCommon(fBuckets.length * 2 + 1); }
/** * Reduces the capacity of and internally reorganizes this * SymbolTable, in order to accommodate and access its entries in * a more memory efficient way. This method is called automatically when * the number of keys in the SymbolTable drops below 25% of this * hashtable's load factor (as a result of SoftReferences which have * been cleared). */ protected void compact() { rehashCommon(((int) (fCount / fLoadFactor)) * 2 + 1); }
/** * Randomly selects a new hash function and reorganizes this SymbolTable * in order to more evenly distribute its entries across the table. This * method is called automatically when the number keys in one of the * SymbolTable's buckets exceeds the given collision threshold. */ protected void rebalance() { if (fHashMultipliers == null) { fHashMultipliers = new int[MULTIPLIERS_SIZE]; } PrimeNumberSequenceGenerator.generateSequence(fHashMultipliers); rehashCommon(fBuckets.length); }