当前位置: 首页>>代码示例>>Java>>正文


Java Set.addAll方法代码示例

本文整理汇总了Java中java.util.Set.addAll方法的典型用法代码示例。如果您正苦于以下问题:Java Set.addAll方法的具体用法?Java Set.addAll怎么用?Java Set.addAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.Set的用法示例。


在下文中一共展示了Set.addAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitSubprojects

import java.util.Set; //导入方法依赖的package包/类
private static void visitSubprojects(Project p, Set<Project> projects, boolean main, ProgressHandle h, int[] startEnd) {
    if ((main || !ProjectConvertors.isConvertorProject(p)) && projects.add(p)) {
        if (h != null) {
            h.progress(progressMessage(p), Math.min(++startEnd[0], startEnd[1]));
        }
        ProjectContainerProvider pcp = p.getLookup().lookup(ProjectContainerProvider.class);
        if (pcp != null) {
            ProjectContainerProvider.Result res = pcp.getContainedProjects();
            projects.addAll(res.getProjects());
            if (!res.isRecursive()) {
                visitSubprojects(p, projects, false, h, startEnd);
            }
        } else {
            //fallback to semi-deprecated subprojectprovider
            SubprojectProvider spp = p.getLookup().lookup(SubprojectProvider.class);
            if (spp != null) {
                for (Project p2 : spp.getSubprojects()) {
                    visitSubprojects(p2, projects, false, h, startEnd);
                }
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:SubprojectsGroup.java

示例2: processTreeKindHint

import java.util.Set; //导入方法依赖的package包/类
private static void processTreeKindHint(Map<HintMetadata, Collection<HintDescription>> hints, MethodWrapper m, HintMetadata metadata) {
    TriggerTreeKind kindTrigger = m.getAnnotation(TriggerTreeKind.class);
    
    if (kindTrigger == null) {
        return ;
    }
    TriggerOptions opts = m.getAnnotation(TriggerOptions.class);
    Worker w = new WorkerImpl(m.getClazz().getName(), m.getName());

    Set<Kind> kinds = EnumSet.noneOf(Kind.class);
    
    kinds.addAll(Arrays.asList(kindTrigger.value()));

    addHint(hints, metadata, HintDescriptionFactory.create()
                                                   .setTrigger(new Kinds(kinds))
                                                   .setTriggerOptions(opts == null ? null : opts.value())
                                                   .setWorker(w)
                                                   .setMetadata(metadata)
                                                   .produce());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:CodeHintProviderImpl.java

示例3: moduleLocations

import java.util.Set; //导入方法依赖的package包/类
private Set<ModuleLocation> moduleLocations(final Location baseLocation) {
    if (!forLocation.equals(baseLocation)) {
        throw new IllegalStateException(String.format(
                "Locations computed for: %s, but queried for: %s",  //NOI18N
                forLocation,
                baseLocation));
    }
    if (moduleLocations == null) {
        final Set<ModuleLocation> moduleRoots = new HashSet<>();
        final Set<URL> seen = new HashSet<>();
        for (ClassPath.Entry e : modulePath.entries()) {
            final URL root = e.getURL();
            if (!seen.contains(root)) {
                final String moduleName = SourceUtils.getModuleName(root);
                if (moduleName != null) {
                    Collection<? extends URL> p = peers.apply(root);
                    moduleRoots.add(ModuleLocation.create(baseLocation, p, moduleName));
                    seen.addAll(p);
                }
            }
        }
        moduleLocations = moduleRoots;
    }
    return moduleLocations;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:ModuleFileManager.java

示例4: test

import java.util.Set; //导入方法依赖的package包/类
public void test(int numberOfSmallBidders, int numberOfHighfrequencyBidders) {
    SRVMWorld world = new SRVMWorld(SRVMWorldGen.getSingleBandWorldSetup(), new JavaUtilRNGSupplier(147258369L));
    Set<SRVMBidderSetup> setups = new HashSet<>();
    setups.addAll(SRVMWorldGen.getSimpleSmallBidderSetup(numberOfSmallBidders));
    setups.addAll(SRVMWorldGen.getSimpleHighFrequencyBidderSetup(numberOfHighfrequencyBidders));
    Collection<SRVMBidder> bidders = world.createPopulation(setups, new JavaUtilRNGSupplier(963852741L));
    SRVM_MIP mip = new SRVM_MIP(bidders);
    SRVMMipResult result = mip.calculateAllocation();
    for (SRVMBidder bidder : bidders) {
        GenericValue<SRVMBand> genVal = result.getAllocation(bidder);
        for (SRVMBand band : bidder.getWorld().getBands()) {
            Integer quantity = genVal.getQuantity(band);
            logger.info(new StringBuilder("bidder ").append(bidder.getId()).append("\t").append(band.toString()).append("\t").append(quantity));
        }
    }
    logger.info("Total value:" + result.getTotalValue());
}
 
开发者ID:spectrumauctions,项目名称:sats-opt,代码行数:18,代码来源:SRVMMipTest.java

示例5: keysSpi

import java.util.Set; //导入方法依赖的package包/类
@Override
protected String[] keysSpi() throws BackingStoreException {
    Set<String> keys = new HashSet<String>();
    checkDelegates();
    for(int i = 0; i < delegates.length; i++) {
        if (delegates[i] != null) {
            try {
                keys.addAll(Arrays.asList(delegates[i].keys()));
            } catch (Exception e) {
                // mark the delegate as invalid
                delegates[i] = null;
            }
        }
    }
    return keys.toArray(new String[ keys.size() ]);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:ProxyPreferences.java

示例6: init

import java.util.Set; //导入方法依赖的package包/类
public static void init()
{
	// Register mod entities
	int entityId = 1;
	EntityRegistry.registerModEntity(new ResourceLocation("btweagles:stevebeej"), EntitySteveBeej.class, "SteveBeej", entityId++, BetterThanWeagles.instance, 64, 3, true, 0xD1A288, 0x00CCCC);

	// Set up spawn criteria
	Set<Biome> validBiomes = new HashSet<>();

	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.PLAINS));
	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.FOREST));
	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.HILLS));
	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.SWAMP));

	validBiomes.removeAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.NETHER));
	validBiomes.removeAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.END));

	EntityRegistry.addSpawn(EntitySteveBeej.class, 10, 1, 1, EnumCreatureType.MONSTER, validBiomes.toArray(new Biome[validBiomes.size()]));

	// Register entity loot tables
	LootTableList.register(EntitySteveBeej.LOOT_TABLE);
}
 
开发者ID:DarkMorford,项目名称:BetterThanWeagles,代码行数:23,代码来源:ModEntities.java

示例7: findPropertiesForPatterns

import java.util.Set; //导入方法依赖的package包/类
private Set<File> findPropertiesForPatterns(final File basedir, final List<String> patterns) throws IOException {
    final Set<File> propertiesFiles = new TreeSet<File>();
    for (final String pattern : patterns) {

        @SuppressWarnings("unchecked")
        final List<File> files = FileUtils.getFiles(basedir, pattern, null);
        propertiesFiles.addAll(files);

    }
    return propertiesFiles;
}
 
开发者ID:thrawn-sh,项目名称:properties-validate,代码行数:12,代码来源:PropertiesInfoPlugin.java

示例8: handleDisjunction

import java.util.Set; //导入方法依赖的package包/类
static Result handleDisjunction(List<Query> disjunctions, int minimumShouldMatch, boolean otherClauses) {
    boolean verified = minimumShouldMatch <= 1 && otherClauses == false;
    Set<Term> terms = new HashSet<>();
    for (Query disjunct : disjunctions) {
        Result subResult = analyze(disjunct);
        if (subResult.verified == false) {
            verified = false;
        }
        terms.addAll(subResult.terms);
    }
    return new Result(verified, terms);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:13,代码来源:QueryAnalyzer.java

示例9: visit

import java.util.Set; //导入方法依赖的package包/类
/**
 * Calls lookup(intExpr) and returns the cached value, if any. If no cached
 * value exists, visits each child, caches the union of the children's
 * return values and returns it.
 * 
 * @return let x = lookup(intExpr) | x != null => x, cache(intExpr,
 *         intExpr.decls.accept(this) + intExpr.intExpr.accept(this))
 */
public Set<T> visit(SumExpression intExpr) {
	Set<T> ret = lookup(intExpr);
	if (ret != null)
		return ret;
	ret = newSet();
	ret.addAll(intExpr.decls().accept(this));
	ret.addAll(intExpr.intExpr().accept(this));
	return cache(intExpr, ret);
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:18,代码来源:AbstractCollector.java

示例10: addToProject

import java.util.Set; //导入方法依赖的package包/类
public static void addToProject(IJavaProject javaProject)
{
	try
	{
		Set<IClasspathEntry> entries = new LinkedHashSet<>();
		entries.addAll(Arrays.asList(javaProject.getRawClasspath()));
		entries.add(JavaCore.newContainerEntry(JPFClasspathPlugin.CONTAINER_PATH));
		javaProject.setRawClasspath(entries.toArray(new IClasspathEntry[entries.size()]), null);
	}
	catch( JavaModelException e )
	{
		JPFClasspathLog.logError(e);
	}

}
 
开发者ID:equella,项目名称:Equella,代码行数:16,代码来源:JPFClasspathContainer.java

示例11: merge

import java.util.Set; //导入方法依赖的package包/类
public Set<Object> merge(Set<?>... items) {

        Set<Object> result = new HashSet<Object>();

        for (Set<?> item : items) {
            if (item != null) {
                result.addAll(item);
            }
        }

        return result;
    }
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:13,代码来源:SetMerger.java

示例12: getCombinationGroups

import java.util.Set; //导入方法依赖的package包/类
/**
 * Returns all Long values which have been used for combinations in this ParallelPair
 * @return a set of all Long values which have been used for combinations in this ParallelPair
 */
public Set<Long> getCombinationGroups() {
    Set<Long> result = new TreeSet<>();
    result.addAll(this.nodeMatch1.keySet());
    result.addAll(this.nodeMatch2.keySet());
    return result;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:11,代码来源:ParallelPair.java

示例13: checkPermissions

import java.util.Set; //导入方法依赖的package包/类
private static void checkPermissions(Context context, PackageInfo packageInfo) {
    int i;
    Set hashSet = new HashSet();
    hashSet.addAll(Arrays.asList(new String[]{"android.permission.INTERNET", "android" +
            ".permission.ACCESS_NETWORK_STATE", context.getPackageName() + ".permission" +
            ".MIPUSH_RECEIVE", "android.permission.ACCESS_WIFI_STATE", "android.permission" +
            ".READ_PHONE_STATE", "android.permission.GET_TASKS", "android.permission" +
            ".VIBRATE"}));
    if (packageInfo.permissions != null) {
        for (PermissionInfo permissionInfo : packageInfo.permissions) {
            if (r4.equals(permissionInfo.name)) {
                i = 1;
                break;
            }
        }
    }
    i = 0;
    if (i == 0) {
        throw new a(String.format("<permission android:name=\"%1$s\" /> is undefined.", new
                Object[]{r4}), null);
    }
    if (packageInfo.requestedPermissions != null) {
        for (CharSequence charSequence : packageInfo.requestedPermissions) {
            if (!TextUtils.isEmpty(charSequence) && hashSet.contains(charSequence)) {
                hashSet.remove(charSequence);
                if (hashSet.isEmpty()) {
                    break;
                }
            }
        }
    }
    if (!hashSet.isEmpty()) {
        throw new a(String.format("<use-permission android:name=\"%1$s\" /> is missing.", new
                Object[]{hashSet.iterator().next()}), null);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:37,代码来源:MiPushClient.java

示例14: join

import java.util.Set; //导入方法依赖的package包/类
String join(List<String> list, String... values) {
    Set<String> concat = Sets.newHashSet(values);
    if (list != null) {
        concat.addAll(list);
    }
    return concat.stream()
        .filter(value -> !Strings.isEmpty(value))
        .collect(Collectors.joining("~"));
}
 
开发者ID:neowu,项目名称:core-ng-demo-project,代码行数:10,代码来源:SearchURLBuilder.java

示例15: keySet

import java.util.Set; //导入方法依赖的package包/类
@Override
public Set<String> keySet() {
    Set<String> keys = new HashSet(vars.keySet());
    keys.addAll(adds.keySet());
    return keys;
}
 
开发者ID:intuit,项目名称:karate,代码行数:7,代码来源:ScriptBindings.java


注:本文中的java.util.Set.addAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。