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); }
/** * 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(); } }
gaps.removeAll(gaps.headSet(smalledAllowedGap)); return new GapAwareTrackingToken(newIndex, gaps);
List<LogoutHandler> result = new ArrayList<LogoutHandler>(); SortedSet<String> logoutFilterNames = getSecurityManager().listFilters(LogoutHandler.class); logoutFilterNames.removeAll(Arrays.asList(skipHandlerName)); Set<String> handlerNames = new HashSet<String>();
SortedSet<String> sortedFuncs = new TreeSet<String>(funcs); sortedFuncs.removeAll(serdeConstants.PrimitiveTypes); Iterator<String> iterFuncs = sortedFuncs.iterator();
SortedSet<String> sortedFuncs = new TreeSet<String>(funcs); sortedFuncs.removeAll(serdeConstants.PrimitiveTypes); Iterator<String> iterFuncs = sortedFuncs.iterator();
allBrokers.removeAll(Arrays.asList(toOptimize, toSwapWith)); try { if (swapReplicas(toOptimize, toSwapWith, meanDiskUsage, clusterModel, excludedTopics)) {
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()); }
/** * 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; } }
/** * 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); }
/** * @param c * @return * @see java.util.AbstractSet#removeAll(java.util.Collection) */ public boolean removeAll(Collection<?> c) { return set.removeAll(c); }
public void remove(Triple... triples) { if(triples!=null && triples.length>0) { this.triples.removeAll(Arrays.asList(triples)); } }
@Override public synchronized boolean removeAll(Collection<?> c) { SortedSet<E> newSet = new TreeSet<E>(internalSet); boolean changed = newSet.removeAll(c); internalSet = newSet; return changed; }
@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; }
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); }
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); }
public Links build() { SortedSet<Long> rights = links.get(-1L); if (rights != null) { rights.removeAll(linkedTos); } return UTILS.linksFrom(links); }
@Override public SortedSet<Integer> getSupportedVersions() { SortedSet<Integer> outputSet = new TreeSet<>(ProtocolRegistry.getSupportedVersions()); outputSet.removeAll(Via.getPlatform().getConf().getBlockedProtocols()); return outputSet; }
@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); }