protected void rehash() { int oldCapacity = table.length; LongLongLinkedEntry oldMap[] = table; int newCapacity = oldCapacity * 2 + 1; LongLongLinkedEntry newMap[] = new LongLongLinkedEntry[newCapacity]; threshold = (int) (newCapacity * loadFactor); table = newMap; for (int i = oldCapacity; i-- > 0;) { LongLongLinkedEntry old = oldMap[i]; while (old != null) { LongLongLinkedEntry e = old; old = old.next; long key = e.key; int index = hash(key) % newCapacity; e.next = newMap[index]; newMap[index] = e; } } }
protected void rehash() { int oldCapacity = table.length; LongLongLinkedEntry oldMap[] = table; int newCapacity = oldCapacity * 2 + 1; LongLongLinkedEntry newMap[] = new LongLongLinkedEntry[newCapacity]; threshold = (int) (newCapacity * loadFactor); table = newMap; for (int i = oldCapacity; i-- > 0;) { LongLongLinkedEntry old = oldMap[i]; while (old != null) { LongLongLinkedEntry e = old; old = old.next; long key = e.key; int index = hash(key) % newCapacity; e.next = newMap[index]; newMap[index] = e; } } }
protected void rehash() { int oldCapacity = table.length; LongLongLinkedEntry oldMap[] = table; int newCapacity = oldCapacity * 2 + 1; LongLongLinkedEntry newMap[] = new LongLongLinkedEntry[newCapacity]; threshold = (int) (newCapacity * loadFactor); table = newMap; for (int i = oldCapacity; i-- > 0;) { LongLongLinkedEntry old = oldMap[i]; while (old != null) { LongLongLinkedEntry e = old; old = old.next; long key = e.key; int index = hash(key) % newCapacity; e.next = newMap[index]; newMap[index] = e; } } }
protected void rehash() { int oldCapacity = table.length; LongLongLinkedEntry oldMap[] = table; int newCapacity = oldCapacity * 2 + 1; LongLongLinkedEntry newMap[] = new LongLongLinkedEntry[newCapacity]; threshold = (int) (newCapacity * loadFactor); table = newMap; for (int i = oldCapacity; i-- > 0;) { LongLongLinkedEntry old = oldMap[i]; while (old != null) { LongLongLinkedEntry e = old; old = old.next; long key = e.key; int index = hash(key) % newCapacity; e.next = newMap[index]; newMap[index] = e; } } }
protected void rehash() { int oldCapacity = table.length; LongLongLinkedEntry oldMap[] = table; int newCapacity = oldCapacity * 2 + 1; LongLongLinkedEntry newMap[] = new LongLongLinkedEntry[newCapacity]; threshold = (int) (newCapacity * loadFactor); table = newMap; for (int i = oldCapacity; i-- > 0;) { LongLongLinkedEntry old = oldMap[i]; while (old != null) { LongLongLinkedEntry e = old; old = old.next; long key = e.key; int index = hash(key) % newCapacity; e.next = newMap[index]; newMap[index] = e; } } }
public synchronized boolean containsKey(long key) { LongLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (LongLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key, key)) { return true; } } return false; }
public synchronized long get(long key) { LongLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (LongLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key, key)) { return e.value; } } return NONE; }
public synchronized long get(long key) { LongLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (LongLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key, key)) { return e.value; } } return NONE; }
public synchronized long get(long key) { LongLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (LongLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key, key)) { return e.value; } } return NONE; }
public synchronized boolean containsKey(long key) { LongLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (LongLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key, key)) { return true; } } return false; }
public synchronized boolean containsKey(long key) { LongLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (LongLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key, key)) { return true; } } return false; }
public synchronized long get(long key) { LongLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (LongLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key, key)) { return e.value; } } return NONE; }
public synchronized long get(long key) { LongLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (LongLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key, key)) { return e.value; } } return NONE; }
public synchronized boolean containsKey(long key) { LongLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (LongLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key, key)) { return true; } } return false; }
public synchronized boolean containsKey(long key) { LongLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (LongLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key, key)) { return true; } } return false; }
public synchronized long remove(long key) { LongLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (LongLongLinkedEntry e = tab[index], prev = null; e != null; prev = e, e = e.next) { if (CompareUtil.equals(e.key, key)) { if (prev != null) { prev.next = e.next; } else { tab[index] = e.next; } count--; long oldValue = e.value; e.value = NONE; // unchain(e); return oldValue; } } return NONE; }
public synchronized long remove(long key) { LongLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (LongLongLinkedEntry e = tab[index], prev = null; e != null; prev = e, e = e.next) { if (CompareUtil.equals(e.key, key)) { if (prev != null) { prev.next = e.next; } else { tab[index] = e.next; } count--; long oldValue = e.value; e.value = NONE; // unchain(e); return oldValue; } } return NONE; }
public synchronized long remove(long key) { LongLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (LongLongLinkedEntry e = tab[index], prev = null; e != null; prev = e, e = e.next) { if (CompareUtil.equals(e.key, key)) { if (prev != null) { prev.next = e.next; } else { tab[index] = e.next; } count--; long oldValue = e.value; e.value = NONE; // unchain(e); return oldValue; } } return NONE; }
public synchronized long remove(long key) { LongLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (LongLongLinkedEntry e = tab[index], prev = null; e != null; prev = e, e = e.next) { if (CompareUtil.equals(e.key, key)) { if (prev != null) { prev.next = e.next; } else { tab[index] = e.next; } count--; long oldValue = e.value; e.value = NONE; // unchain(e); return oldValue; } } return NONE; }
public synchronized long remove(long key) { LongLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (LongLongLinkedEntry e = tab[index], prev = null; e != null; prev = e, e = e.next) { if (CompareUtil.equals(e.key, key)) { if (prev != null) { prev.next = e.next; } else { tab[index] = e.next; } count--; long oldValue = e.value; e.value = NONE; // unchain(e); return oldValue; } } return NONE; }