public int addLast(String key, int value) { return _add(key, value, MODE.FORCE_LAST); }
public int putLast(String key, int value) { return _put(key, value, MODE.FORCE_LAST); }
public static byte getValue(String name) { return (byte)nameList.get(name); }
return NONE; StringIntLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringIntLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key, key)) { case FORCE_FIRST: if (header.link_next != e) { unchain(e); chain(header, header.link_next, e); unchain(e); chain(header.link_prev, header, e); long v = remove(k); overflowed(k, v); long v = remove(k); overflowed(k, v); rehash(); tab = table; index = hash(key) % tab.length; case FORCE_FIRST: case FIRST: chain(header, header.link_next, e); break; case FORCE_LAST:
public String toFormatString() { StringBuffer buf = new StringBuffer(); Enumeration it = entries(); buf.append("{\n"); while (it.hasMoreElements()) { StringIntLinkedEntry e = (StringIntLinkedEntry) it.nextElement(); buf.append("\t").append(e.getKey() + "=" + e.getValue()).append("\n"); } buf.append("}"); return buf.toString(); }
protected void rehash() { int oldCapacity = table.length; StringIntLinkedEntry oldMap[] = table; int newCapacity = oldCapacity * 2 + 1; StringIntLinkedEntry newMap[] = new StringIntLinkedEntry[newCapacity]; threshold = (int) (newCapacity * loadFactor); table = newMap; for (int i = oldCapacity; i-- > 0;) { StringIntLinkedEntry old = oldMap[i]; while (old != null) { StringIntLinkedEntry e = old; old = old.next; String key = e.key; int index = hash(key) % newCapacity; e.next = newMap[index]; newMap[index] = e; } } }
public synchronized int getFirsValue() { if (isEmpty()) return NONE; return this.header.link_next.value; }
public static StringEnumer names() { return nameList.keys(); }
return NONE; StringIntLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringIntLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key, key)) { case FORCE_FIRST: if (header.link_next != e) { unchain(e); chain(header, header.link_next, e); unchain(e); chain(header.link_prev, header, e); long v = remove(k); overflowed(k, v); long v = remove(k); overflowed(k, v); rehash(); tab = table; index = hash(key) % tab.length; case FORCE_FIRST: case FIRST: chain(header, header.link_next, e); break; case FORCE_LAST:
public String toFormatString() { StringBuffer buf = new StringBuffer(); Enumeration it = entries(); buf.append("{\n"); while (it.hasMoreElements()) { StringIntLinkedEntry e = (StringIntLinkedEntry) it.nextElement(); buf.append("\t").append(e.getKey() + "=" + e.getValue()).append("\n"); } buf.append("}"); return buf.toString(); }
protected void rehash() { int oldCapacity = table.length; StringIntLinkedEntry oldMap[] = table; int newCapacity = oldCapacity * 2 + 1; StringIntLinkedEntry newMap[] = new StringIntLinkedEntry[newCapacity]; threshold = (int) (newCapacity * loadFactor); table = newMap; for (int i = oldCapacity; i-- > 0;) { StringIntLinkedEntry old = oldMap[i]; while (old != null) { StringIntLinkedEntry e = old; old = old.next; String key = e.key; int index = hash(key) % newCapacity; e.next = newMap[index]; newMap[index] = e; } } }
public synchronized int getFirsValue() { if (isEmpty()) return NONE; return this.header.link_next.value; }
public static StringEnumer names() { return nameList.keys(); }
return NONE; StringIntLinkedEntry tab[] = table; int index = hash(key) % tab.length; for (StringIntLinkedEntry e = tab[index]; e != null; e = e.next) { if (CompareUtil.equals(e.key, key)) { case FORCE_FIRST: if (header.link_next != e) { unchain(e); chain(header, header.link_next, e); unchain(e); chain(header.link_prev, header, e); long v = remove(k); overflowed(k, v); long v = remove(k); overflowed(k, v); rehash(); tab = table; index = hash(key) % tab.length; case FORCE_FIRST: case FIRST: chain(header, header.link_next, e); break; case FORCE_LAST: