/** * Removes the first occurrence of the requested value, and returns the index it was removed at (-1 if not found) * @param value a value in this IntVLA to remove * @return the index the value was found and removed at, or -1 if it was not present */ public int removeValue (int value) { int[] items = this.items; for (int i = 0, n = size; i < n; i++) { if (items[i] == value) { removeIndex(i); return i; } } return -1; }
/** Removes from this array all of elements contained in the specified array. * @return true if this array was modified. */ public boolean removeAll (IntVLA array) { int size = this.size; int startSize = size; int[] items = this.items; for (int i = 0, n = array.size; i < n; i++) { int item = array.get(i); for (int ii = 0; ii < size; ii++) { if (item == items[ii]) { removeIndex(ii); size--; break; } } } return size != startSize; }
/** * Removes the first key in iteration order. * * @return the first key. * @throws NoSuchElementException is this set is empty. */ public K removeFirst() { if (size == 0) throw new NoSuchElementException(); final int pos = order.removeIndex(0); final K k = key[pos]; size--; if (k == null) { containsNull = false; key[n] = null; } else shiftKeys(pos); if (size < maxFill / 4 && n > DEFAULT_INITIAL_SIZE) rehash(n / 2); return k; }
/** * 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 V removeFirst() { if (size == 0) throw new NoSuchElementException(); final int pos = order.removeIndex(0); size--; final V v = value[pos]; if (pos == n) { containsNullKey = false; key[n] = null; value[n] = null; } else shiftKeys(pos); if (size < maxFill / 4 && n > DEFAULT_INITIAL_SIZE) rehash(n / 2); return v; } /**
/** * 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 K removeFirst() { if (size == 0) throw new NoSuchElementException(); final int pos = order.removeIndex(0); K fst = key[pos]; size--; final int v = value[pos]; if (pos == n) { containsNullKey = false; key[n] = null; } else shiftKeys(pos); fixValues(v); if (size < maxFill / 4 && n > DEFAULT_INITIAL_SIZE) rehash(n / 2); return fst; } /**
/** * Processes the first key event queued up, passing it to this object's InputProcessor. Mouse events are not * queued and are processed when they come in. */ public void next() { IntVLA qu = queue; if (keyAction == null) { qu.clear(); // Accidentally captured a keypress when keys aren't meant to be handled return; } if (qu.isEmpty()) { return; } int t = qu.removeIndex(0); t = mapping.get(t, t); keyAction.handle((char)t, (t & 0x10000) != 0, (t & 0x20000) != 0, (t & 0x40000) != 0); }
/** * Reduces the likelihood of generating the given T item by the given weight, which can reduce the chance below 0 * and thus remove the item entirely. Does not affect nested ProbabilityTables. The value for weight must be greater * than 0, otherwise this simply returns false without doing anything. Returns true iff the probabilities changed. * @param item the item to make less likely or impossible * @param weight how much to reduce the item's weight by, as a positive non-zero int (greater values here subtract * more from the item's weight) * @return true if the probability changed or false if nothing changed */ public boolean remove(T item, int weight) { if(weight <= 0) return false; int idx = table.getInt(item); if(idx < 0) return false; int o = weights.get(idx); weights.incr(idx, -weight); int w = weights.get(idx); if(w <= 0) { table.removeAt(idx); weights.removeIndex(idx); } w = Math.min(o, o - w); total -= w; normalTotal -= w; return true; }
order.removeIndex(value[pos]); order.insert(at, pos); return pos; order.removeIndex(value[pos]); order.insert(at, pos); return pos;
fsz = fresh.size; for (int ci = fsz-1; ci >= 0; ci--) { cen = fresh.removeIndex(ci); cenX = decodeX(cen); cenY = decodeY(cen);
next = -1; order.removeIndex(index); size--; int last, slot, pos = curr;
fsz = fresh.size; for (int ci = fsz-1; ci >= 0; ci--) { cen = fresh.removeIndex(ci); cenX = decodeX(cen); cenY = decodeY(cen);
fsz = fresh.size; for (int ci = fsz-1; ci >= 0; ci--) { cen = fresh.removeIndex(ci); cenX = decodeX(cen); cenY = decodeY(cen);
fsz = fresh.size; for (int ci = fsz-1; ci >= 0; ci--) { cen = fresh.removeIndex(ci); cenX = decodeX(cen); cenY = decodeY(cen);
currentFresh.removeIndex(index); anyFreshMap.remove(cx, cy);
fsz = fresh.size; for (int ci = fsz-1; ci >= 0; ci--) { cen = fresh.removeIndex(ci); cenX = decodeX(cen); cenY = decodeY(cen);
fsz = fresh.size; for (int ci = fsz-1; ci >= 0; ci--) { cen = fresh.removeIndex(ci); cenX = decodeX(cen); cenY = decodeY(cen);
fsz = fresh.size; for (int ci = fsz-1; ci >= 0; ci--) { cen = fresh.removeIndex(ci); dist = gradientMap[cen]; for (int d = 0; d < neighborCount; d++) {
fsz = fresh.size; for (int ci = fsz-1; ci >= 0; ci--) { cen = fresh.removeIndex(ci); dist = gradientMap[cen]; for (int d = 0; d < neighborCount; d++) {
fsz = fresh.size; for (int ci = fsz-1; ci >= 0; ci--) { cen = fresh.removeIndex(ci); dist = gradientMap[cen]; for (int d = 0; d < neighborCount; d++) {
fsz = fresh.size; for (int ci = fsz-1; ci >= 0; ci--) { cen = fresh.removeIndex(ci); dist = gradientMap[cen]; for (int d = 0; d < neighborCount; d++) {