/** * Removes the first key in iteration order. * * @return the first key. * @throws NoSuchElementException * is this set is empty. */ public long removeFirstLong() { 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; } final long k = key[pos]; size--; if (((k) == (0))) { containsNull = false; key[n] = (0); } else shiftKeys(pos); if (n > minN && size < maxFill / 4 && n > DEFAULT_INITIAL_SIZE) rehash(n / 2); return k; } /**
/** * Removes the the last key in iteration order. * * @return the last key. * @throws NoSuchElementException * is this set is empty. */ public long removeLastLong() { 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; } final long k = key[pos]; size--; if (((k) == (0))) { containsNull = false; key[n] = (0); } else shiftKeys(pos); if (n > minN && size < maxFill / 4 && n > DEFAULT_INITIAL_SIZE) rehash(n / 2); return k; } private void moveIndexToFirst(final int i) {
private boolean removeEntry(final int pos) { size--; fixPointers(pos); shiftKeys(pos); if (n > minN && size < maxFill / 4 && n > DEFAULT_INITIAL_SIZE) rehash(n / 2); return true; } private boolean removeNullEntry() {