/** * Returns the key+value pair with the max priority (min for minHeap mode) * <ul> * <li> key+value pair is removed from the priority queue. </li> * <li> Throws runtime exception if the priority queue is empty. </li> * <li> Runtime complexity of O(1). </li> * </ul> * * @return Key+Value pair */ public IntObjectPair<T> poll() { if (isEmpty()) { throw new RuntimeException("Empty collection, nothing to remove"); } else { IntObjectPair<T> poll = peek(); int lastIndex = _values.size() - 1; swapValues(0, lastIndex); _values.remove(lastIndex); _keyToIndexMap.remove(_indexToKeyMap.get(lastIndex)); _indexToKeyMap.remove(lastIndex); if (!_values.isEmpty()) { siftDown(0); } return poll; } }
@Override public void deleteInstance(int i) { instanceList.remove(i); }
@Override public void deleteInstance(int i) { instanceList.remove(i); }
@Override public void remove() { if (last == -1) throw new IllegalStateException(); ObjectArrayList.this.remove(last); /* * If the last operation was a next(), we are removing an element *before* us, * and we must decrease pos correspondingly. */ if (last < pos) pos--; last = -1; } };
@Override public boolean remove(final Object k) { int index = indexOf(k); if (index == -1) return false; remove(index); assert size <= a.length; return true; } @Override
@Override public T remove(final int index) { this.checkRange(index, this.usedElements); final T oldObject = super.remove(index); super.add(oldObject); this.usedElements--; return oldObject; }
public double[] getMetricValues(String... metrics) { ObjectArrayList<String> metricsNoScore = ObjectArrayList.wrap(metrics.clone()); metricsNoScore.remove("score"); metricsNoScore.remove("AUC"); metricsNoScore.remove("AUC+F1"); metricsNoScore.trim(); String[] elements = metricsNoScore.toArray(new String[metricsNoScore.size()]);
hitsOnCurrentDocument.remove(0);
rightScores.toByteArray(new byte[rightScores.size()])); blocks.remove(block); newBlocks.add(left); newBlocks.add(right);