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


Java List.addAll方法代码示例

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


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

示例1: joinFiles

import java.util.List; //导入方法依赖的package包/类
private Iterable<? extends JavaFileObject> joinFiles(
        List<String> files, List<JavaFileObject> fileObjects) {
    if (files == null)
        return fileObjects;
    if (internalFileManager == null)
        internalFileManager = compiler.getStandardFileManager(null, null, null);
    Iterable<? extends JavaFileObject> filesAsFileObjects =
            internalFileManager.getJavaFileObjectsFromStrings(files);
    if (fileObjects == null)
        return filesAsFileObjects;
    List<JavaFileObject> combinedList = new ArrayList<>();
    for (JavaFileObject o : filesAsFileObjects)
        combinedList.add(o);
    combinedList.addAll(fileObjects);
    return combinedList;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:JavacTask.java

示例2: formatUserEnName

import java.util.List; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
private List<String> formatUserEnName(SearchResult sResult) {

    if (null == sResult) {
        return Collections.emptyList();
    }

    List<String> result = new ArrayList<String>();
    try {
        String memberKey = ldapConfig.get("memberKey");
        NamingEnumeration namingEnumeration = sResult.getAttributes().getAll();
        while (namingEnumeration.hasMoreElements()) {
            Attribute attr = (Attribute) namingEnumeration.next();
            String attrId = attr.getID();
            if (memberKey.equals(attrId)) {
                List<String> userEnNames = formatUserEnName(attr);
                result.addAll(userEnNames);
            }
        }

    }
    catch (Exception e) {
        loggerError("formatUserEnName 619", "", e);
    }
    return result;
}
 
开发者ID:uavorg,项目名称:uavstack,代码行数:27,代码来源:GUISSOLdapClient.java

示例3: getSimpleWordList

import java.util.List; //导入方法依赖的package包/类
public List<Word> getSimpleWordList()
{
    List<IWord> wordList = getWordList();
    List<Word> simpleWordList = new LinkedList<Word>();
    for (IWord word : wordList)
    {
        if (word instanceof CompoundWord)
        {
            simpleWordList.addAll(((CompoundWord) word).innerList);
        }
        else
        {
            simpleWordList.add((Word) word);
        }
    }

    return simpleWordList;
}
 
开发者ID:priester,项目名称:hanlpStudy,代码行数:19,代码来源:Document.java

示例4: main

import java.util.List; //导入方法依赖的package包/类
public static void main (String... args) throws Exception {

        LingeredApp app = null;

        if (!Platform.shouldSAAttach()) {
            System.out.println(
               "SA attach not expected to work - test skipped.");
            return;
        }

        try {
            List<String> vmArgs = new ArrayList<String>();
            vmArgs.add("-XX:+ProfileInterpreter");
            vmArgs.addAll(Utils.getVmOptions());

            app = LingeredApp.startApp(vmArgs);
            System.out.println ("Started LingeredApp with pid " + app.getPid());
            startClhsdbForPrintMdo(app.getPid());
            verifyPrintMdoOutput();
        } finally {
            LingeredApp.stopApp(app);
        }
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:TestPrintMdo.java

示例5: bitpos

import java.util.List; //导入方法依赖的package包/类
public void bitpos(final byte[] key, final boolean value, final BitPosParams params) {
	final List<byte[]> args = new ArrayList<byte[]>();
	args.add(key);
	args.add(toByteArray(value));
	args.addAll(params.getParams());
	sendCommand(BITPOS, args.toArray(new byte[args.size()][]));
}
 
开发者ID:qq1588518,项目名称:JRediClients,代码行数:8,代码来源:BinaryClient.java

示例6: Sorted

import java.util.List; //导入方法依赖的package包/类
/**
     * Ctor.
     * @param src The underlying collection
     * @param cmp The comparator
     */
    public Sorted(final Comparator<T> cmp, final Collection<T> src) {
        super(() -> {
            final List<T> items = new ArrayList<>(src.size());
            items.addAll(src);
            items.sort(cmp);
            return Collections.unmodifiableList(items);
        }
);
    }
 
开发者ID:yegor256,项目名称:cactoos,代码行数:15,代码来源:Sorted.java

示例7: computeTestMethods

import java.util.List; //导入方法依赖的package包/类
@Override
protected List<FrameworkMethod> computeTestMethods() {
    final List<FrameworkMethod> testMethods = new ArrayList<>();
    final Spockito.Unroll unroll = testMethod.getAnnotation(Spockito.Unroll.class);
    if (unroll == null) {
        testMethods.add(testMethod);
    } else {
        final Table table = Table.parse(unroll.value());
        testMethods.addAll(unroll(table));
    }
    return testMethods;
}
 
开发者ID:tools4j,项目名称:spockito,代码行数:13,代码来源:SingleTestMultiRowRunner.java

示例8: getDefaultClasspathEntries

import java.util.List; //导入方法依赖的package包/类
@Override
public IClasspathEntry[] getDefaultClasspathEntries()
{
	List<IClasspathEntry> entries = new ArrayList<>();
	entries.addAll(Arrays.asList(PreferenceConstants.getDefaultJRELibrary()));
	entries.add(JavaCore.newContainerEntry(JPFClasspathPlugin.CONTAINER_PATH));
	return entries.toArray(new IClasspathEntry[entries.size()]);
}
 
开发者ID:equella,项目名称:Equella,代码行数:9,代码来源:NewJPFPluginWizardPageOne.java

示例9: ClassSizeInfo

import java.util.List; //导入方法依赖的package包/类
public ClassSizeInfo(final Class<?> clazz) {
    long newFieldsSize = 0;
    final List<Field> newReferenceFields = new LinkedList<>();
    for (final Field f : clazz.getDeclaredFields()) {
        if (Modifier.isStatic(f.getModifiers())) {
            continue;
        }
        final Class<?> type = f.getType();
        if (type.isPrimitive()) {
            newFieldsSize += getPrimitiveFieldSize(type);
        } else {
            f.setAccessible(true);
            newReferenceFields.add(f);
            newFieldsSize += referenceSize;
        }
    }
    final Class<?> superClass = clazz.getSuperclass();
    if (superClass != null) {
        final ClassSizeInfo superClassInfo = getClassSizeInfo(superClass);
        newFieldsSize += roundTo(superClassInfo.fieldsSize, superclassFieldPadding);
        newReferenceFields.addAll(Arrays.asList(superClassInfo.referenceFields));
    }
    this.fieldsSize = newFieldsSize;
    this.objectSize = roundTo(objectHeaderSize + newFieldsSize, objectPadding);
    this.referenceFields = newReferenceFields.toArray(
            new Field[0]);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:ObjectSizeCalculator.java

示例10: getMapObjectLayers

import java.util.List; //导入方法依赖的package包/类
@Override
public List<IMapObjectLayer> getMapObjectLayers() {
  final List<IMapObjectLayer> shapeLayers = new CopyOnWriteArrayList<>();
  if (this.getObjectgroups() != null) {
    shapeLayers.addAll(this.getObjectgroups());
  }
  return shapeLayers;
}
 
开发者ID:gurkenlabs,项目名称:litiengine,代码行数:9,代码来源:Map.java

示例11: listAllDirsDislikeNamesNoCase

import java.util.List; //导入方法依赖的package包/类
/**
 * 列出file目录下所有不包含names列表中任意名称的目录,忽略大小写,包括子目录
 *
 * @param list  文件列表,传出参数
 * @param names 名称列表
 * @param file  文件
 */
public static void listAllDirsDislikeNamesNoCase(List<File> list, File file, String[] names)
{
    File[] files = listDirsDislikeNamesNoCase(file, names);
    list.addAll(Arrays.asList(files));
    files = listDirs(file);
    for(File f : files)
    {
        listAllDirsDislikeNamesNoCase(list, f, names);
    }
}
 
开发者ID:Ayvytr,项目名称:EasyAndroid,代码行数:18,代码来源:FileTool.java

示例12: isValid

import java.util.List; //导入方法依赖的package包/类
@Override
public boolean isValid(ILaunchConfiguration config) {
	// Validate each addon
	try {
		List<IEngineAddon> addons = new ArrayList<IEngineAddon>();
		for (Entry<EngineAddonSpecificationExtension, Button> entry : _components.entrySet()) {
			if (entry.getValue().getSelection()) {
				addons.add(entry.getKey().instanciateComponent());
			}
		}
		List<String> errors = new ArrayList<String>();
		for (IEngineAddon iEngineAddon : addons) {
			errors.addAll(iEngineAddon.validate(addons));
		}
		if (!errors.isEmpty()) {
			for (String msg : errors) {
				setErrorMessage(msg);
			}
			return false;
		}
	} catch (Exception e) {
		e.printStackTrace();
	}

	setErrorMessage(null);
	return true;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:28,代码来源:LaunchConfigurationDataProcessingTab.java

示例13: getSyncedFields

import java.util.List; //导入方法依赖的package包/类
public static List<SyncedField> getSyncedFields(Object te, Class searchedAnnotation) {
    List<SyncedField> syncedFields = new ArrayList<SyncedField>();
    Class examinedClass = te.getClass();
    while (examinedClass != null) {
        for (Field field : examinedClass.getDeclaredFields()) {
            if (field.getAnnotation(searchedAnnotation) != null) {
                syncedFields.addAll(getSyncedFieldsForField(field, te, searchedAnnotation));
            }
        }
        examinedClass = examinedClass.getSuperclass();
    }
    return syncedFields;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:14,代码来源:NetworkUtils.java

示例14: configMutliCluster

import java.util.List; //导入方法依赖的package包/类
public void configMutliCluster(ZooKeeper zk) {
    if (_servers.size() == 1) {
        return;
    }
    String cluster1 = _servers.get(0);
    try {
        if (_servers.size() > 1) {
            // 强制的声明accessible
            ReflectionUtils.makeAccessible(clientCnxnField);
            ReflectionUtils.makeAccessible(hostProviderField);
            ReflectionUtils.makeAccessible(serverAddressesField);

            // 添加第二组集群列表
            for (int i = 1; i < _servers.size(); i++) {
                String cluster = _servers.get(i);
                // 强制获取zk中的地址信息
                ClientCnxn cnxn = (ClientCnxn) ReflectionUtils.getField(clientCnxnField, zk);
                HostProvider hostProvider = (HostProvider) ReflectionUtils.getField(hostProviderField, cnxn);
                List<InetSocketAddress> serverAddrs = (List<InetSocketAddress>) ReflectionUtils.getField(serverAddressesField,
                                                                                                         hostProvider);
                // 添加第二组集群列表
                serverAddrs.addAll(new ConnectStringParser(cluster).getServerAddresses());
            }
        }
    } catch (Exception e) {
        try {
            if (zk != null) {
                zk.close();
            }
        } catch (InterruptedException ie) {
            // ignore interrupt
        }
        throw new ZkException("zookeeper_create_error, serveraddrs=" + cluster1, e);
    }

}
 
开发者ID:luoyaogui,项目名称:otter-G,代码行数:37,代码来源:ZooKeeperx.java

示例15: getAllChildren

import java.util.List; //导入方法依赖的package包/类
public List<QubbleCuboid> getAllChildren()
{
	List<QubbleCuboid> children = new ArrayList<>();

	for (QubbleCuboid cuboid : this.children)
	{
		children.add(cuboid);
		children.addAll(cuboid.getAllChildren());
	}

	return children;
}
 
开发者ID:ObsidianSuite,项目名称:ObsidianSuite,代码行数:13,代码来源:QubbleCuboid.java


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