本文整理汇总了Java中java.util.SortedSet.removeAll方法的典型用法代码示例。如果您正苦于以下问题:Java SortedSet.removeAll方法的具体用法?Java SortedSet.removeAll怎么用?Java SortedSet.removeAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.SortedSet
的用法示例。
在下文中一共展示了SortedSet.removeAll方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SuiteProperties
import java.util.SortedSet; //导入方法依赖的package包/类
/**
* Creates a new instance of SuiteProperties
*/
public SuiteProperties(SuiteProject project, AntProjectHelper helper,
PropertyEvaluator evaluator, Set<NbModuleProject> subModules) {
super(helper, evaluator);
this.project = project;
refresh(subModules);
this.disabledModules = getArrayProperty(evaluator, DISABLED_MODULES_PROPERTY);
this.enabledClusters = getArrayProperty(evaluator, ENABLED_CLUSTERS_PROPERTY);
if (enabledClusters.length == 0 && activePlatform != null) {
// Compatibility.
SortedSet<String> clusters = new TreeSet<String>();
for (ModuleEntry module : activePlatform.getModules()) {
clusters.add(module.getClusterDirectory().getName());
}
clusters.removeAll(Arrays.asList(getArrayProperty(evaluator, DISABLED_CLUSTERS_PROPERTY)));
enabledClusters = new String[clusters.size()];
int i = 0; for (String cluster : clusters) {
enabledClusters[i++] = SingleModuleProperties.clusterBaseName(cluster);
}
}
brandingModel = new SuiteBrandingModel(this);
brandingModel.init();
}
示例2: build
import java.util.SortedSet; //导入方法依赖的package包/类
public List<CloudApplicationExtended> build(Set<String> mtaModulesInArchive, Set<String> allMtaModules, Set<String> deployedModules)
throws SLException {
List<CloudApplicationExtended> apps = new ArrayList<>();
SortedSet<String> unresolvedMtaModules = new TreeSet<>(allMtaModules);
initializeModulesDependecyTypes(deploymentDescriptor);
for (Module module : handler.getSortedModules(deploymentDescriptor, SupportedParameters.DEPENDENCY_TYPE, DEPENDECY_TYPE_HARD)) {
if (!mtaModulesInArchive.contains(module.getName()) || module.getType() == null) {
if (deployedModules.contains(module.getName())){
printMTAModuleNotFoundWarning(module.getName());
}
continue;
}
if (allMtaModules.contains(module.getName())) {
ListUtil.addNonNull(apps, getApplication(module));
unresolvedMtaModules.remove(module.getName());
} else {
throw new ContentException(Messages.ARCHIVE_MODULE_NOT_INTENDED_FOR_DEPLOYMENT, module.getName());
}
}
unresolvedMtaModules.removeAll(deployedModules);
if (!unresolvedMtaModules.isEmpty()) {
throw new ContentException(Messages.UNRESOLVED_MTA_MODULES, unresolvedMtaModules);
}
return apps;
}
示例3: deregisterServiceProvider
import java.util.SortedSet; //导入方法依赖的package包/类
public static void deregisterServiceProvider(final String serviceProviderId)
{
synchronized(serviceProviders)
{
final ServiceProvider deregisteredServiceProvider =
serviceProviders.remove(serviceProviderIdentifier(serviceProviderId));
if (deregisteredServiceProvider != null)
{
final SortedSet<URI> remainingDomains = new TreeSet<URI>();
for (final ServiceProvider remainingServiceProvider : serviceProviders.values())
{
remainingDomains.addAll(getServiceProviderDomains(remainingServiceProvider));
}
final SortedSet<URI> removedServiceProviderDomains = getServiceProviderDomains(deregisteredServiceProvider);
removedServiceProviderDomains.removeAll(remainingDomains);
serviceProviderCatalog.removeDomains(removedServiceProviderDomains);
serviceProviderCatalog.removeServiceProvider(deregisteredServiceProvider);
}
else
{
throw new WebApplicationException(Status.NOT_FOUND);
}
}
}
示例4: removeAll
import java.util.SortedSet; //导入方法依赖的package包/类
@Override
public synchronized boolean removeAll(Collection<?> c) {
SortedSet<E> newSet = new TreeSet<E>(internalSet);
boolean changed = newSet.removeAll(c);
internalSet = newSet;
return changed;
}
示例5: doOperation
import java.util.SortedSet; //导入方法依赖的package包/类
/**
* Utility that could be on SortedSet. Allows faster implementation than
* what is in Java for doing addAll, removeAll, retainAll, (complementAll).
* @param a first set
* @param relation the relation filter, using ANY, CONTAINS, etc.
* @param b second set
* @return the new set
*/
public static <T extends Object & Comparable<? super T>> SortedSet<? extends T> doOperation(SortedSet<T> a, int relation, SortedSet<T> b) {
// TODO: optimize this as above
TreeSet<? extends T> temp;
switch (relation) {
case ADDALL:
a.addAll(b);
return a;
case A:
return a; // no action
case B:
a.clear();
a.addAll(b);
return a;
case REMOVEALL:
a.removeAll(b);
return a;
case RETAINALL:
a.retainAll(b);
return a;
// the following is the only case not really supported by Java
// although all could be optimized
case COMPLEMENTALL:
temp = new TreeSet<T>(b);
temp.removeAll(a);
a.removeAll(b);
a.addAll(temp);
return a;
case B_REMOVEALL:
temp = new TreeSet<T>(b);
temp.removeAll(a);
a.clear();
a.addAll(temp);
return a;
case NONE:
a.clear();
return a;
default:
throw new IllegalArgumentException("Relation " + relation + " out of range");
}
}