protected void rehash() { int oldCapacity = table.length; StringLongLinkedEntry oldMap[] = table; int newCapacity = oldCapacity * 2 + 1; StringLongLinkedEntry newMap[] = new StringLongLinkedEntry[newCapacity]; threshold = (int) (newCapacity * loadFactor); table = newMap; for (int i = oldCapacity; i-- > 0;) { StringLongLinkedEntry old = oldMap[i]; while(old!=null) { StringLongLinkedEntry e = old; old = old.next; String key = e.key; int index = hash(key) % newCapacity; e.next = newMap[index]; newMap[index] = e; } } } private int max;
protected void rehash() { int oldCapacity = table.length; StringLongLinkedEntry oldMap[] = table; int newCapacity = oldCapacity * 2 + 1; StringLongLinkedEntry newMap[] = new StringLongLinkedEntry[newCapacity]; threshold = (int) (newCapacity * loadFactor); table = newMap; for (int i = oldCapacity; i-- > 0;) { StringLongLinkedEntry old = oldMap[i]; while(old!=null) { StringLongLinkedEntry e = old; old = old.next; String key = e.key; int index = hash(key) % newCapacity; e.next = newMap[index]; newMap[index] = e; } } } private int max;
protected void rehash() { int oldCapacity = table.length; StringLongLinkedEntry oldMap[] = table; int newCapacity = oldCapacity * 2 + 1; StringLongLinkedEntry newMap[] = new StringLongLinkedEntry[newCapacity]; threshold = (int) (newCapacity * loadFactor); table = newMap; for (int i = oldCapacity; i-- > 0;) { StringLongLinkedEntry old = oldMap[i]; while(old!=null) { StringLongLinkedEntry e = old; old = old.next; String key = e.key; int index = hash(key) % newCapacity; e.next = newMap[index]; newMap[index] = e; } } } private int max;
protected void rehash() { int oldCapacity = table.length; StringLongLinkedEntry oldMap[] = table; int newCapacity = oldCapacity * 2 + 1; StringLongLinkedEntry newMap[] = new StringLongLinkedEntry[newCapacity]; threshold = (int) (newCapacity * loadFactor); table = newMap; for (int i = oldCapacity; i-- > 0;) { StringLongLinkedEntry old = oldMap[i]; while(old!=null) { StringLongLinkedEntry e = old; old = old.next; String key = e.key; int index = hash(key) % newCapacity; e.next = newMap[index]; newMap[index] = e; } } } private int max;
protected void rehash() { int oldCapacity = table.length; StringLongLinkedEntry oldMap[] = table; int newCapacity = oldCapacity * 2 + 1; StringLongLinkedEntry newMap[] = new StringLongLinkedEntry[newCapacity]; threshold = (int) (newCapacity * loadFactor); table = newMap; for (int i = oldCapacity; i-- > 0;) { StringLongLinkedEntry old = oldMap[i]; while(old!=null) { StringLongLinkedEntry e = old; old = old.next; String key = e.key; int index = hash(key) % newCapacity; e.next = newMap[index]; newMap[index] = e; } } } private int max;
public synchronized boolean containsKey(String key) { StringLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key,key)) { return true; } } return false; } public synchronized long get(String key) {
public synchronized boolean containsKey(String key) { StringLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key,key)) { return true; } } return false; } public synchronized long get(String key) {
public synchronized boolean containsKey(String key) { StringLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key,key)) { return true; } } return false; } public synchronized long get(String key) {
public synchronized boolean containsKey(String key) { StringLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key,key)) { return true; } } return false; } public synchronized long get(String key) {
public synchronized boolean containsKey(String key) { StringLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key,key)) { return true; } } return false; } public synchronized long get(String key) {
public synchronized long get(String key) { if(key==null) return NONE; StringLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key,key)) { return e.value; } } return NONE; } public synchronized long getFirsValue() {
public synchronized long get(String key) { if(key==null) return NONE; StringLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key,key)) { return e.value; } } return NONE; } public synchronized long getFirsValue() {
public synchronized long get(String key) { if(key==null) return NONE; StringLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key,key)) { return e.value; } } return NONE; } public synchronized long getFirsValue() {
public synchronized long get(String key) { if(key==null) return NONE; StringLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key,key)) { return e.value; } } return NONE; } public synchronized long getFirsValue() {
public synchronized long get(String key) { if(key==null) return NONE; StringLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringLongLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key,key)) { return e.value; } } return NONE; } public synchronized long getFirsValue() {
public synchronized long remove(String key) { if(key==null) return NONE; StringLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringLongLinkedEntry 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 removeFirst() {
public synchronized long remove(String key) { if(key==null) return NONE; StringLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringLongLinkedEntry 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 removeFirst() {
public synchronized long remove(String key) { if(key==null) return NONE; StringLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringLongLinkedEntry 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 removeFirst() {
public synchronized long remove(String key) { if(key==null) return NONE; StringLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringLongLinkedEntry 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 removeFirst() {
public synchronized long remove(String key) { if(key==null) return NONE; StringLongLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringLongLinkedEntry 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 removeFirst() {