/** * Returns true if the priority queue is empty, false otherwise. * * @return True if empty, false otherwise */ public boolean isEmpty() { return _values.isEmpty(); }
/** * Returns the key+value pair with the max priority (min for minHeap mode) * <ul> * <li> key+value pair is not removed from the priority queue. </li> * <li> Returns null if the priority queue is empty. </li> * <li> Runtime complexity of O(1). </li> * </ul> * * @return Key+Value pair */ public IntObjectPair<T> peek() { if (_values.isEmpty()) { return null; } _reusablePair.setIntValue(_indexToKeyMap.get(0)); _reusablePair.setObjectValue(_values.get(0)); return _reusablePair; }
/** * 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; } }
/** Checks whether this callback builder is empty. * * @return true if this callback builder is empty. */ public boolean isEmpty() { return callbacks.isEmpty(); }
/** Checks whether this callback builder is empty. * * @return true if this callback builder is empty. */ public boolean isEmpty() { return callbacks.isEmpty(); }
/** Checks whether this callback builder is empty. * * @return true if this callback builder is empty. */ public boolean isEmpty() { return callbacks.isEmpty(); }
private void ensureBlocksNotEmpty() { if ( blocks.isEmpty() ) throw new IllegalStateException( "You must add at least one block before reading or closing a segmented stream" ); }
private void ensureBlocksNotEmpty() { if (blocks.isEmpty()) throw new IllegalStateException("You must add at least one block before reading or closing a segmented stream"); }
private void ensureBlocksNotEmpty() { if ( blocks.isEmpty() ) throw new IllegalStateException( "You must add at least one block before reading or closing a segmented stream" ); }
private void assertParent(LongArrayBitVector v, ParexData<T> parexData, ObjectArrayList<InternalNode<T>> stack) { assert (parexData.parexNode == null) == stack.isEmpty() : (parexData.parexNode == null) + " != " + stack.isEmpty(); assert parexData.parexNode != null || parexData.exitNode == root; assert parexData.parexNode == null || parexData.parexNode.left == parexData.exitNode || parexData.parexNode.right == parexData.exitNode; for(final InternalNode<T> node : stack) { assert v.equals(node.extent(transform), Math.max(0, node.nameLength - 1), node.extentLength); } }
if ( ! results.isEmpty() ) { SelectedInterval[] selectedInterval = null;
if ( ! results.isEmpty() ) { SelectedInterval[] selectedInterval = null;
if ( ! results.isEmpty() ) { SelectedInterval[] selectedInterval = null;
InternalNode<T> top = stack == null || stack.isEmpty() ? null : stack.top(); int pos;
if(hitsOnCurrentDocument.isEmpty()){
} while(! jumpStack.isEmpty());