protected boolean canProcess(Object row, int tag) throws HiveException { keyWrapper.getNewKey(row, inputObjInspectors[tag]); keyWrapper.setHashKey(); if (!priorityQueue.contains(keyWrapper)) { priorityQueue.offer(keyWrapper.copyKey()); } if (priorityQueue.size() > topN) { priorityQueue.poll(); } return priorityQueue.contains(keyWrapper); }
private int countTreeHelper(Tree tree, int prediction, Map<Integer, PriorityQueue<Tree>> ngrams) { if (tree.isLeaf()) { return 1; } int treeSize = 0; for (Tree child : tree.children()) { treeSize += countTreeHelper(child, prediction, ngrams); } if (maximumLength > 0 && treeSize > maximumLength) { return treeSize; } PriorityQueue<Tree> queue = getPriorityQueue(treeSize, prediction, ngrams); // TODO: should we allow classes which aren't the best possible // class for this tree to be included in the results? if (!queue.contains(tree)) { queue.add(tree); } if (queue.size() > ngramCount) { queue.poll(); } return treeSize; }
if (pq.contains(adjacentNode)) { pq.remove(adjacentNode);
nfaState.getPartialMatches().removeIf(pm -> pm.getStartEventID() != null && !partialMatches.contains(pm));
@Override public boolean contains(Object o) { return this.queue.contains(o); }
@Override public boolean contains(Object o) { return this.queue.contains(o); }
public boolean contains(IBrokerReservation r) { return queue.contains(r); }
public boolean contains(Object o) { return entries.contains(o); }
private void addEvictedDependency(ResolvedDependency dependency) { if (!evictedVersions.contains(dependency)) { // TODO maybe inefficient evictedVersions.add(dependency); } }
public boolean add(E e) { boolean isAdded = false; if (!super.contains(e)) { isAdded = super.add(e); } return isAdded; }
private void add (Binding binding) { if ( distinct ) { if ( !heap.contains(binding) ) heap.add(binding) ; } else { heap.add(binding) ; } }
private void add(Binding binding) { if ( distinct && heap.contains(binding) ) return ; if ( heap.size() >= limit ) heap.poll() ; // Remove front element. heap.add(binding) ; }
public synchronized boolean insert(final BroadcastMessage mb) { final boolean inserted = false; seen.add(mb.hashCode()); // this check probably isn't necessary but just to be sure... if (!outbox.contains(mb)) { // TODO: it doesn't check the size of the queue, it may get too big outbox.add(mb); logger.info("Added broadcast message to outbox.") ; } return inserted; }
@VisibleForTesting boolean containsInAnyCache(String url) { return mNearbyUrls.contains(url) || mResolvedUrls.contains(url) || mUrlInfoMap.containsKey(url) || mUrlsSortedByTimestamp.contains(url); }
public void remove(Double value){ if (upperQueue.contains(value)){ upperQueue.remove(value); } else { lowerQueue.remove(value); } balance(); } }
public void revertBlock() { this.state.update(true); instances.remove(this.block); if (REVERT_QUEUE.contains(this)) { REVERT_QUEUE.remove(this); } if (this.revertTask != null) { this.revertTask.run(); } }
@Override public boolean contains(Object object) { if (!_directAccess && isDelayLoad()) { load(); } return super.contains(object); }
@Override public boolean contains(Object object) { if (!_directAccess && isDelayLoad()) { load(); } return super.contains(object); }
@Override public boolean contains(Object object) { if (!_directAccess && isDelayLoad()) { load(); } return super.contains(object); }
@Override public boolean contains(Object object) { if (!_directAccess && isDelayLoad()) { load(); } return super.contains(object); }