當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。