()
| 232 | } |
| 233 | |
| 234 | private void enlargeIfNeeded() |
| 235 | { |
| 236 | if(used < keys.length*loadFactor) |
| 237 | return; |
| 238 | //enlarge |
| 239 | final byte[] oldSatus = status; |
| 240 | final int[] oldKeys = keys; |
| 241 | final double[] oldTable = table; |
| 242 | |
| 243 | int newSize = getNextPow2TwinPrime(status.length*3/2);//it will actually end up doubling in size since we have twin primes spaced that was |
| 244 | status = new byte[newSize]; |
| 245 | keys = new int[newSize]; |
| 246 | table = new double[newSize]; |
| 247 | |
| 248 | used = 0; |
| 249 | for(int oldIndex = 0; oldIndex < oldSatus.length; oldIndex++) |
| 250 | if(oldSatus[oldIndex] == OCCUPIED) |
| 251 | put(oldKeys[oldIndex], oldTable[oldIndex]); |
| 252 | } |
| 253 | |
| 254 | @Override |
| 255 | public boolean containsKey(Object key) |
no test coverage detected