本文整理了Java中java.util.SortedSet.removeAll()
方法的一些代码示例,展示了SortedSet.removeAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SortedSet.removeAll()
方法的具体详情如下:
包路径:java.util.SortedSet
类名称:SortedSet
方法名:removeAll
暂无
代码示例来源:origin: geoserver/geoserver
SortedSet<GeoServerUser> getUsersNotHavingProperty(String propname) throws IOException {
if (StringUtils.hasLength(propname) == false) return emptyUsers;
SortedSet<GeoServerUser> users = getUsersHavingProperty(propname);
SortedSet<GeoServerUser> result = new TreeSet<GeoServerUser>();
result.addAll(userMap.values());
result.removeAll(users);
return Collections.unmodifiableSortedSet(result);
}
代码示例来源:origin: apache/ignite
/**
* Removes given nodes and all their replicas from consistent hash algorithm
* (if nodes are {@code null} or empty, then no-op).
*
* @param nodes Nodes to remove.
*/
public void removeNodes(@Nullable Collection<N> nodes) {
if (F.isEmpty(nodes))
return;
rw.writeLock().lock();
try {
if (!this.nodes.removeAll(nodes))
return;
for (Iterator<SortedSet<N>> it = circle.values().iterator(); it.hasNext(); ) {
SortedSet<N> set = it.next();
if (!set.removeAll(nodes))
continue;
if (set.isEmpty())
it.remove();
}
}
finally {
rw.writeLock().unlock();
}
}
代码示例来源:origin: AxonFramework/AxonFramework
gaps.removeAll(gaps.headSet(smalledAllowedGap));
return new GapAwareTrackingToken(newIndex, gaps);
代码示例来源:origin: geoserver/geoserver
List<LogoutHandler> result = new ArrayList<LogoutHandler>();
SortedSet<String> logoutFilterNames = getSecurityManager().listFilters(LogoutHandler.class);
logoutFilterNames.removeAll(Arrays.asList(skipHandlerName));
Set<String> handlerNames = new HashSet<String>();
代码示例来源:origin: apache/hive
SortedSet<String> sortedFuncs = new TreeSet<String>(funcs);
sortedFuncs.removeAll(serdeConstants.PrimitiveTypes);
Iterator<String> iterFuncs = sortedFuncs.iterator();
代码示例来源:origin: apache/drill
SortedSet<String> sortedFuncs = new TreeSet<String>(funcs);
sortedFuncs.removeAll(serdeConstants.PrimitiveTypes);
Iterator<String> iterFuncs = sortedFuncs.iterator();
代码示例来源:origin: linkedin/cruise-control
allBrokers.removeAll(Arrays.asList(toOptimize, toSwapWith));
try {
if (swapReplicas(toOptimize, toSwapWith, meanDiskUsage, clusterModel, excludedTopics)) {
代码示例来源:origin: google/guava
public void testElementSetSubsetRemoveAll() {
TreeMultiset<String> ms = TreeMultiset.create();
ms.add("a", 1);
ms.add("b", 3);
ms.add("c", 2);
ms.add("d", 1);
ms.add("e", 3);
ms.add("f", 2);
SortedSet<String> elementSet = ms.elementSet();
assertThat(elementSet).containsExactly("a", "b", "c", "d", "e", "f").inOrder();
SortedSet<String> subset = elementSet.subSet("b", "f");
assertThat(subset).containsExactly("b", "c", "d", "e").inOrder();
assertTrue(subset.removeAll(Arrays.asList("a", "c")));
assertThat(elementSet).containsExactly("a", "b", "d", "e", "f").inOrder();
assertThat(subset).containsExactly("b", "d", "e").inOrder();
assertEquals(10, ms.size());
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Removes the prefix from each requested path and enqueues paths that have
* not been previously resolved for the next batch of work.
*/
public void addPaths(String prefix, Collection<String> requestedPaths) {
if (clientObject == null) {
// No point trying to follow paths past a null value
return;
}
// Identity comparison intentional
if (toResolve == EMPTY) {
toResolve = new TreeSet<String>();
}
prefix = prefix.isEmpty() ? prefix : (prefix + ".");
int prefixLength = prefix.length();
for (String path : requestedPaths) {
if (path.startsWith(prefix)) {
toResolve.add(path.substring(prefixLength));
} else if (path.startsWith("*.")) {
toResolve.add(path.substring("*.".length()));
}
}
toResolve.removeAll(resolved);
if (toResolve.isEmpty()) {
toResolve = EMPTY;
}
}
代码示例来源:origin: spotify/heroic
/**
* Apply the given feature set.
*
* @param featureSet Feature set to apply.
* @return A new Feature with the given set applied.
*/
public Features applySet(final FeatureSet featureSet) {
final SortedSet<Feature> features = new TreeSet<>(this.features);
features.addAll(featureSet.getEnabled());
features.removeAll(featureSet.getDisabled());
return new Features(features);
}
代码示例来源:origin: com.aol.cyclops/cyclops-core
/**
* @param c
* @return
* @see java.util.AbstractSet#removeAll(java.util.Collection)
*/
public boolean removeAll(Collection<?> c) {
return set.removeAll(c);
}
代码示例来源:origin: SmartDataAnalytics/DL-Learner
private void _removeAll(Collection<String> toBeRemoved) {
if (posTrain.removeAll(toBeRemoved) || negTrain.removeAll(toBeRemoved)
|| posTest.removeAll(toBeRemoved) || negTest.removeAll(toBeRemoved)) {
logger.warn("There has been some overlap in the examples, but it was removed automatically");
}
}
代码示例来源:origin: ldp4j/ldp4j
public void remove(Triple... triples) {
if(triples!=null && triples.length>0) {
this.triples.removeAll(Arrays.asList(triples));
}
}
代码示例来源:origin: harbby/presto-connectors
@Override
public synchronized boolean removeAll(Collection<?> c) {
SortedSet<E> newSet = new TreeSet<E>(internalSet);
boolean changed = newSet.removeAll(c);
internalSet = newSet;
return changed;
}
代码示例来源:origin: VREMSoftwareDevelopment/WiFiAnalyzer
@NonNull
SortedSet<Integer> findChannels(@NonNull String countryCode) {
SortedSet<Integer> results = new TreeSet<>(channels);
SortedSet<Integer> exclude = channelsToExclude.get(StringUtils.capitalize(countryCode));
if (exclude != null) {
results.removeAll(exclude);
}
return results;
}
代码示例来源:origin: cmu-phil/tetrad
private synchronized void clearArrow(Node x, Node y) {
final OrderedPair<Node> pair = new OrderedPair<>(x, y);
final Set<Arrow> lookupArrows = this.lookupArrows.get(pair);
if (lookupArrows != null) {
sortedArrows.removeAll(lookupArrows);
}
this.lookupArrows.remove(pair);
}
代码示例来源:origin: SmartDataAnalytics/DL-Learner
private void makeNegativeExamplesFromRelatedInstances(String oneInstance, String objectnamespace) {
// SortedSet<String> result = new TreeSet<String>();
String SPARQLquery = "SELECT * WHERE { \n" + "<" + oneInstance + "> " + "?p ?object. \n"
+ "FILTER (REGEX(str(?object), '" + objectnamespace + "')).\n" + "}";
fromRelated.addAll(sparqltasks.queryAsSet(SPARQLquery, "object"));
fromRelated.removeAll(fullPositiveSet);
}
代码示例来源:origin: ohmdb/ohmdb
public Links build() {
SortedSet<Long> rights = links.get(-1L);
if (rights != null) {
rights.removeAll(linkedTos);
}
return UTILS.linksFrom(links);
}
代码示例来源:origin: MylesIsCool/ViaVersion
@Override
public SortedSet<Integer> getSupportedVersions() {
SortedSet<Integer> outputSet = new TreeSet<>(ProtocolRegistry.getSupportedVersions());
outputSet.removeAll(Via.getPlatform().getConf().getBlockedProtocols());
return outputSet;
}
代码示例来源:origin: apache/activemq-artemis
@Test
public void testCompareConnectionFactoryAndResourceAdapterProperties() throws Exception {
SortedSet<String> connectionFactoryProperties = findAllPropertyNames(ActiveMQConnectionFactory.class);
Assert.assertTrue(connectionFactoryProperties.contains("useTopologyForLoadBalancing"));
connectionFactoryProperties.removeAll(UNSUPPORTED_CF_PROPERTIES);
SortedSet<String> raProperties = findAllPropertyNames(ActiveMQResourceAdapter.class);
raProperties.removeAll(UNSUPPORTED_RA_PROPERTIES);
compare("ActiveMQ Connection Factory", connectionFactoryProperties, "ActiveMQ Resource Adapter", raProperties);
}
内容来源于网络,如有侵权,请联系作者删除!