本文整理了Java中java.util.LinkedHashSet.removeAll()
方法的一些代码示例,展示了LinkedHashSet.removeAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LinkedHashSet.removeAll()
方法的具体详情如下:
包路径:java.util.LinkedHashSet
类名称:LinkedHashSet
方法名:removeAll
暂无
代码示例来源:origin: redisson/redisson
final LineageInfo il = getLineageInfo(i);
if (il != null) {
ancestors.removeAll(il.lineage);
ancestors.addAll(il.lineage);
specificity += il.specificity;
代码示例来源:origin: org.apache.hadoop/hadoop-common
allAddrs.addAll(Collections.list(netIf.getInetAddresses()));
if (!returnSubinterfaces) {
allAddrs.removeAll(getSubinterfaceInetAddrs(netIf));
代码示例来源:origin: RuedigerMoeller/fast-serialization
final LineageInfo il = getLineageInfo(i);
if (il != null) {
ancestors.removeAll(il.lineage);
ancestors.addAll(il.lineage);
specificity += il.specificity;
代码示例来源:origin: org.apache.hadoop/hadoop-common
allAddrs.addAll(Collections.list(netIf.getInetAddresses()));
if (!returnSubinterfaces) {
allAddrs.removeAll(getSubinterfaceInetAddrs(netIf));
代码示例来源:origin: prestodb/presto
referencedSymbols.removeAll(lambdaArguments);
Set<Symbol> captureSymbols = referencedSymbols;
代码示例来源:origin: jamesagnew/hapi-fhir
@Override
public boolean removeAll(Collection<?> theC) {
myOrderedTags = null;
return myTagSet.removeAll(theC);
}
代码示例来源:origin: org.elasticsearch/elasticsearch
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);
}
}
代码示例来源:origin: com.vaadin/vaadin-server
/**
* 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;
}
代码示例来源:origin: com.vaadin/vaadin-server
/**
* 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;
}
代码示例来源:origin: geotools/geotools
/**
* 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);
}
}
代码示例来源:origin: ahmetaa/zemberek-nlp
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);
}
}
代码示例来源:origin: apache/accumulo
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);
}
}
代码示例来源:origin: ahmetaa/zemberek-nlp
resultSet.removeAll(wordsToExclude);
代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-base
@Override
public boolean removeAll(Collection<?> theC) {
myOrderedTags = null;
return myTagSet.removeAll(theC);
}
代码示例来源:origin: io.snappydata/gemfire-core
@Override
public boolean removeAll(Collection c) {
//if (c instanceof StructSet) {
//return removeAll((StructSet)c);
//}
return super.removeAll(c);
}
代码示例来源:origin: org.jboss.web/jbossweb
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);
}
代码示例来源:origin: com.sun.enterprise/auto-depends
/**
* 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);
}
代码示例来源:origin: yahoo/elide
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));
}
代码示例来源:origin: com.yahoo.elide/elide-core
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));
}
代码示例来源:origin: org.geotools/gt-metadata
/**
* 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);
}
}
内容来源于网络,如有侵权,请联系作者删除!