@Override public boolean cancel(boolean interruptIfRunning) { synchronized (waitingFutures) { waitingFutures.remove(this); } return true; } }
/** * Fluent method to remove the specified element from this set. */ public FluentHashSet<E> delete(Object o) { super.remove(o); return this; } }
/** * Caller must hold the rwLock */ @Override protected boolean removeFromOtherLists(Long position) { return this.durableIDsList.remove(position); }
public boolean remove(K key) { synchronized (this.set) { return this.set.remove(key); } }
public void removeChild(MaterializedField field) { children.remove(field); }
protected void removeChild(Matcher child) { children.remove(child); }
private void moveToNextFrequency(CacheNode<Key, Value> currentNode, int nextFrequency, LinkedHashSet<CacheNode<Key, Value>> currentNodes, LinkedHashSet<CacheNode<Key, Value>> newNodes) { currentNodes.remove(currentNode); newNodes.add(currentNode); currentNode.frequency = nextFrequency; }
public void test3Bugs(LinkedHashSet<? extends CharSequence> set) { set.remove(Integer.valueOf(3)); }
/** * Remove id from recent list * * @param id * @return this recent list */ public RecentRepositories remove(final long id) { if (ids == null) { load(); } ids.remove(id); return this; }
private void checkSize() { if (this.set.size() >= this.maxSize) { Iterator<K> i = this.set.iterator(); while (i.hasNext() && this.set.size() > this.maxSize) this.set.remove(i.next()); } }
private boolean addRecordAndEvictIfNecessary(GlobalMetadata recordToAdd) { // First remove the element from the HashSet if it's already in there to reset // the 'LRU' piece; then add it back in boolean isNew = !metadataRecords.remove(recordToAdd); metadataRecords.add(recordToAdd); // Now remove the first element (which should be the oldest) from the list // if we've exceeded the cache size if (cacheSize != -1 && metadataRecords.size() > cacheSize) { Iterator<GlobalMetadata> recordIt = metadataRecords.iterator(); recordIt.next(); // Remove the oldest element - don't care what it is recordIt.remove(); } return isNew; }
Supplier<String> doCreateSupplier(final LinkedHashSet<String> set, final SSLSession sslSession) { final Supplier<String> prevSupplier = prev.doCreateSupplier(set, sslSession); return () -> { final String name = prevSupplier.get(); if (name != null) { return name; } if (set.remove(mechName)) { return mechName; } return null; }; }
public void forgetLastBug() { Data d = map.get(lastBug); if (d != null) { d.allSource.remove(lastSourceLine); if (d.allSource.isEmpty()) { map.remove(lastBug); hashes.remove(lastBug.getInstanceHash()); } } lastBug = null; lastSourceLine = null; }
public Value remove(Object k) { CacheNode<Key, Value> currentNode = cache.remove(k); if (currentNode != null) { LinkedHashSet<CacheNode<Key, Value>> nodes = frequencyList[currentNode.frequency]; nodes.remove(currentNode); if (lowestFrequency == currentNode.frequency) { findNextLowestFrequency(); } return currentNode.v; } else { return null; } }
/** * After evicting or deleting or loading an entity, we don't * need to batch fetch it anymore, remove it from the queue * if necessary */ public void removeBatchLoadableEntityKey(EntityKey key) { if ( key.isBatchLoadable() ) { LinkedHashSet<EntityKey> set = batchLoadableEntityKeys.get( key.getEntityName()); if (set != null) { set.remove(key); } } }
/** * Add id to recent list * * @param id * @return this recent list */ public RecentRepositories add(final long id) { if (ids == null) { load(); } ids.remove(id); ids.add(id); trim(); return this; }
public boolean contains(K key) { synchronized (this.set) { // we remove the value to add it again at the end of the list if (!this.set.remove(key)) { this.stats.miss(); return false; // in case that the entry does not exist we are ready here } // the new entry gets to the end of the list this.set.add(key); } this.stats.hit(); return true; }
public boolean add(K key) { boolean oldval; synchronized (this.set) { // make room; this may remove entries from the beginning of the list checkSize(); // we remove the value first to ensure that the value gets at the end of the list oldval = this.set.remove(key); // the new value gets to the end of the list this.set.add(key); } this.stats.update(); return oldval; }
public void removePerspective( SpoonPerspective per ) { perspectives.remove( per ); orderedPerspectives.remove( per ); Document document = domContainer.getDocumentRoot(); XulComponent comp = document.getElementById( "perspective-" + per.getId() ); comp.getParent().removeChild( comp ); comp = document.getElementById( "perspective-btn-" + per.getId() ); comp.getParent().removeChild( comp ); XulToolbar mainToolbar = (XulToolbar) domContainer.getDocumentRoot().getElementById( "main-toolbar" ); ( (Composite) mainToolbar.getManagedObject() ).layout( true, true ); deck.setSelectedIndex( 0 ); }