final LineageInfo il = getLineageInfo(i); if (il != null) { ancestors.removeAll(il.lineage); ancestors.addAll(il.lineage); specificity += il.specificity;
allAddrs.addAll(Collections.list(netIf.getInetAddresses())); if (!returnSubinterfaces) { allAddrs.removeAll(getSubinterfaceInetAddrs(netIf));
final LineageInfo il = getLineageInfo(i); if (il != null) { ancestors.removeAll(il.lineage); ancestors.addAll(il.lineage); specificity += il.specificity;
allAddrs.addAll(Collections.list(netIf.getInetAddresses())); if (!returnSubinterfaces) { allAddrs.removeAll(getSubinterfaceInetAddrs(netIf));
referencedSymbols.removeAll(lambdaArguments); Set<Symbol> captureSymbols = referencedSymbols;
@Override public boolean removeAll(Collection<?> theC) { myOrderedTags = null; return myTagSet.removeAll(theC); }
private void onTimeoutInternal(List<? extends BatchedTask> tasks, TimeValue timeout) { final ArrayList<BatchedTask> toRemove = new ArrayList<>(); for (BatchedTask task : tasks) { if (task.processed.getAndSet(true) == false) { logger.debug("task [{}] timed out after [{}]", task.source, timeout); toRemove.add(task); } } if (toRemove.isEmpty() == false) { BatchedTask firstTask = toRemove.get(0); Object batchingKey = firstTask.batchingKey; assert tasks.stream().allMatch(t -> t.batchingKey == batchingKey) : "tasks submitted in a batch should share the same batching key: " + tasks; synchronized (tasksPerBatchingKey) { LinkedHashSet<BatchedTask> existingTasks = tasksPerBatchingKey.get(batchingKey); if (existingTasks != null) { existingTasks.removeAll(toRemove); if (existingTasks.isEmpty()) { tasksPerBatchingKey.remove(batchingKey); } } } onTimeout(toRemove, timeout); } }
/** * Gets the items that were added to selection. * <p> * This is just a convenience method for checking what is new selected in * {@link #getNewSelection()} and wasn't selected in * {@link #getOldSelection()}. * * @return the items that were removed from selection */ public Set<T> getAddedSelection() { LinkedHashSet<T> copy = new LinkedHashSet<>(getValue()); copy.removeAll(getOldValue()); return copy; }
/** * Gets the items that were removed from selection. * <p> * This is just a convenience method for checking what was previously * selected in {@link #getOldSelection()} but not selected anymore in * {@link #getNewSelection()}. * * @return the items that were removed from selection */ public Set<T> getRemovedSelection() { LinkedHashSet<T> copy = new LinkedHashSet<>(getOldValue()); copy.removeAll(getNewSelection()); return copy; }
/** * Removes all of this set's elements that are also contained in the specified collection. * * @throws UnsupportedOperationException if this collection is unmodifiable. */ @Override public boolean removeAll(Collection<?> c) throws UnsupportedOperationException { synchronized (getLock()) { checkWritePermission(); return super.removeAll(c); } }
private static void removeZemberekDictionaryWordsFromList(Path input, Path out) throws IOException { LinkedHashSet<String> list = new LinkedHashSet<>( Files.readAllLines(input, StandardCharsets.UTF_8)); System.out.println("Total amount of lines = " + list.size()); TurkishMorphology morphology = TurkishMorphology.create( RootLexicon.builder().addTextDictionaryResources( "tr/master-dictionary.dict", "tr/non-tdk.dict", "tr/proper.dict", "tr/proper-from-corpus.dict", "tr/abbreviations.dict" ).build()); List<String> toRemove = new ArrayList<>(); for (DictionaryItem item : morphology.getLexicon()) { if (list.contains(item.lemma)) { toRemove.add(item.lemma); } } System.out.println("Total amount to remove = " + toRemove.size()); list.removeAll(toRemove); try (PrintWriter pw = new PrintWriter(out.toFile(), "utf-8")) { list.forEach(pw::println); } }
private void markUnusedWALs() { List<DfsLogger> closedCopy; synchronized (closedLogs) { closedCopy = copyClosedLogs(closedLogs); } ReferencedRemover refRemover = new ReferencedRemover() { @Override public void removeInUse(Set<DfsLogger> candidates) { for (Tablet tablet : getOnlineTablets()) { tablet.removeInUseLogs(candidates); if (candidates.isEmpty()) { break; } } } }; Set<DfsLogger> eligible = findOldestUnreferencedWals(closedCopy, refRemover); try { TServerInstance session = this.getTabletSession(); for (DfsLogger candidate : eligible) { log.info("Marking " + candidate.getPath() + " as unreferenced"); walMarker.walUnreferenced(session, candidate.getPath()); } synchronized (closedLogs) { closedLogs.removeAll(eligible); } } catch (WalMarkerException ex) { log.info(ex.toString(), ex); } }
resultSet.removeAll(wordsToExclude);
@Override public boolean removeAll(Collection<?> theC) { myOrderedTags = null; return myTagSet.removeAll(theC); }
@Override public boolean removeAll(Collection c) { //if (c instanceof StructSet) { //return removeAll((StructSet)c); //} return super.removeAll(c); }
static void moveToEnd(final LinkedHashSet<Cipher> ciphers, final Collection<Cipher> toBeMovedCiphers) { List<Cipher> movedCiphers = new ArrayList<Cipher>(toBeMovedCiphers); movedCiphers.retainAll(ciphers); ciphers.removeAll(movedCiphers); ciphers.addAll(movedCiphers); }
/** * Given the set of annotations that comprise Hk2, as well as the provided classpath / files to * introspect, return the set of URIs that did not provide any "significant value" * pertaining to habitat creation. */ private Set<URI> getInsignificantURIReferences() { LinkedHashSet<URI> result = new LinkedHashSet<URI>(); result.addAll(parsed); result.removeAll(getSignificantURIReferences()); return Collections.unmodifiableSet(result); }
public void saveOrCreateObjects() { dirtyResources.removeAll(newPersistentResources); // Delete has already been called on these objects dirtyResources.removeAll(deletedResources); newPersistentResources .stream() .map(PersistentResource::getObject) .forEach(s -> transaction.createObject(s, this)); dirtyResources.stream().map(PersistentResource::getObject).forEach(obj -> transaction.save(obj, this)); }
public void saveOrCreateObjects() { dirtyResources.removeAll(newPersistentResources); // Delete has already been called on these objects dirtyResources.removeAll(deletedResources); newPersistentResources .stream() .map(PersistentResource::getObject) .forEach(s -> transaction.createObject(s, this)); dirtyResources.stream().map(PersistentResource::getObject).forEach(obj -> transaction.save(obj, this)); }
/** * Removes all of this set's elements that are also contained in the specified collection. * * @throws UnsupportedOperationException if this collection is unmodifiable. */ @Override public boolean removeAll(Collection<?> c) throws UnsupportedOperationException { synchronized (getLock()) { checkWritePermission(); return super.removeAll(c); } }