/** * Removes the mapping associated with the last key in iteration order. * * @return the value previously associated with the last key in iteration order. * @throws NoSuchElementException * is this map is empty. */ public int removeLastInt() { if (size == 0) throw new NoSuchElementException(); final int pos = last; // Abbreviated version of fixPointers(pos) last = (int) (link[pos] >>> 32); if (0 <= last) { // Special case of SET_NEXT(link[last], -1) link[last] |= -1 & 0xFFFFFFFFL; } size--; final int v = value[pos]; if (pos == n) { containsNullKey = false; key[n] = null; } else shiftKeys(pos); if (n > minN && size < maxFill / 4 && n > DEFAULT_INITIAL_SIZE) rehash(n / 2); return v; } private void moveIndexToFirst(final int i) {
/** * Removes the mapping associated with the first key in iteration order. * * @return the value previously associated with the first key in iteration * order. * @throws NoSuchElementException * is this map is empty. */ public int removeFirstInt() { if (size == 0) throw new NoSuchElementException(); final int pos = first; // Abbreviated version of fixPointers(pos) first = (int) link[pos]; if (0 <= first) { // Special case of SET_PREV(link[first], -1) link[first] |= (-1 & 0xFFFFFFFFL) << 32; } size--; final int v = value[pos]; if (pos == n) { containsNullKey = false; key[n] = null; } else shiftKeys(pos); if (n > minN && size < maxFill / 4 && n > DEFAULT_INITIAL_SIZE) rehash(n / 2); return v; } /**
private int removeEntry(final int pos) { final int oldValue = value[pos]; size--; fixPointers(pos); shiftKeys(pos); if (n > minN && size < maxFill / 4 && n > DEFAULT_INITIAL_SIZE) rehash(n / 2); return oldValue; } private int removeNullEntry() {