當前位置: 首頁>>代碼示例>>Java>>正文


Java LinkedList.addAll方法代碼示例

本文整理匯總了Java中java.util.LinkedList.addAll方法的典型用法代碼示例。如果您正苦於以下問題:Java LinkedList.addAll方法的具體用法?Java LinkedList.addAll怎麽用?Java LinkedList.addAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.util.LinkedList的用法示例。


在下文中一共展示了LinkedList.addAll方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getRemovedSymmetryGraph2

import java.util.LinkedList; //導入方法依賴的package包/類
public LinkedList<Edge> getRemovedSymmetryGraph2() {
	LinkedList<Edge> list = new LinkedList<>();
	for(LinkedList<Edge> edges : edgesByVertices.values()) {
		list.addAll(edges);
	}
	
	if(graphType != GraphType.UNDIRECTED)
		return list;
	
	for(int i=0 ; i<list.size() ; i++) {
		Edge e1 = list.get(i);
		
		for(int j=0 ; j<list.size() ; j++) {
			Edge e2 = list.get(j);
			
			if(e1.checkSymmetry(e2))
				list.remove(j);
		}
	}
	
	return list;
}
 
開發者ID:xeyez,項目名稱:StationGraph,代碼行數:23,代碼來源:AbstractGraph.java

示例2: writeLog

import java.util.LinkedList; //導入方法依賴的package包/類
public void writeLog(String logEntry) {
    BeaconAction beaconAction = new BeaconAction(logEntry, System.currentTimeMillis());

    LinkedList<BeaconAction> logsList = new LinkedList<>();
    logsList.addAll(getLogs());

    //add new entry at the beginning
    logsList.add(0, beaconAction);

    StringBuilder stringBuilder = new StringBuilder();
    for (BeaconAction action : logsList) {
        stringBuilder
                .append(action.actionName).append(VALUE_SEPARATOR)
                .append(action.timestamp)
                .append(ENTRY_SEPARATOR);
    }
    //remove last separator
    stringBuilder.replace(stringBuilder.length() - 1, stringBuilder.length() - 1, EMPTY_STRING);

    preferences.edit().putString(PREFERENCE_LOGS, stringBuilder.toString()).apply();
}
 
開發者ID:upnext,項目名稱:BeaconControl_Android_sample_app,代碼行數:22,代碼來源:BeaconActionsLogsStore.java

示例3: addJobListener

import java.util.LinkedList; //導入方法依賴的package包/類
public void addJobListener(JobListener jobListener, List<Matcher<JobKey>> matchers) {
    if (jobListener.getName() == null || jobListener.getName().length() == 0) {
        throw new IllegalArgumentException(
                "JobListener name cannot be empty.");
    }
    
    synchronized (globalJobListeners) {
        globalJobListeners.put(jobListener.getName(), jobListener);
        LinkedList<Matcher<JobKey>> matchersL = new  LinkedList<Matcher<JobKey>>();
        if(matchers != null && matchers.size() > 0)
            matchersL.addAll(matchers);
        else
            matchersL.add(EverythingMatcher.allJobs());
        
        globalJobListenersMatchers.put(jobListener.getName(), matchersL);
    }
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:18,代碼來源:ListenerManagerImpl.java

示例4: processJar

import java.util.LinkedList; //導入方法依賴的package包/類
/**
 * Store all class names found in this jar file
 */
private static LinkedList<String> processJar(File jarfile, String basepath) {
	// System.out.println("Processing JAR " + jarfile.getPath());
	LinkedList<String> addlist = new LinkedList<String>();
	try {
		JarInputStream jarIS = new JarInputStream(new FileInputStream(
				jarfile));

		JarEntry entry = null;
		while ((entry = jarIS.getNextJarEntry()) != null) {
			String name = entry.getName();
			if (name.endsWith(".class")) {
				// System.out.println( entry.getAttributes().toString() );
				if (!add(name, jarfile.getPath(), basepath).isEmpty())
					addlist.addAll(add(name, jarfile.getPath(), basepath));
			}
		}
	} catch (Exception e) {
	}
	return addlist;
}
 
開發者ID:etomica,項目名稱:etomica,代碼行數:24,代碼來源:Lister.java

示例5: processDirectory

import java.util.LinkedList; //導入方法依賴的package包/類
/**
 * Recursively store all class names found in this directory and its
 * subdirectories
 */
private static LinkedList<String> processDirectory(File directory, String basepath) {
	// System.out.println("Processing " + directory.getPath());
	LinkedList<String> addlist = new LinkedList<String>();
	File[] files = directory.listFiles();
	for (int i = 0; i < files.length; i++) {
		File currentFile = files[i];
		String name = currentFile.getName();

		if (currentFile.isDirectory()) {
			if (!processDirectory(currentFile, basepath).isEmpty())
				addlist.addAll(processDirectory(currentFile, basepath));

		} else if (name.endsWith(".class")) {
			if (!add(name, currentFile.getPath(), basepath).isEmpty())
				addlist.addAll(add(name, currentFile.getPath(), basepath));

		} else if (name.endsWith(".jar")) {
			if (!processJar(currentFile, basepath).isEmpty())
				addlist.addAll(processJar(currentFile, basepath));
		}
	}
	return addlist;
}
 
開發者ID:etomica,項目名稱:etomica,代碼行數:28,代碼來源:Lister.java

示例6: getWorkflows

import java.util.LinkedList; //導入方法依賴的package包/類
@Override
public List<WorkflowInstance> getWorkflows(WorkflowInstanceQuery workflowInstanceQuery, int maxItems, int skipCount)
{
    LinkedList<WorkflowInstance> results = new LinkedList<WorkflowInstance>();
    if (Boolean.FALSE.equals(workflowInstanceQuery.getActive()) == false)
    {
        //Add active. 
        results.addAll(getWorkflowsInternal(workflowInstanceQuery, true, maxItems, skipCount));
    }
    if (Boolean.TRUE.equals(workflowInstanceQuery.getActive()) == false)
    {
        //Add complete
        results.addAll(getWorkflowsInternal(workflowInstanceQuery, false, maxItems, skipCount));
    }
    
    return results;
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:18,代碼來源:ActivitiWorkflowEngine.java

示例7: testAddAll2_IndexOutOfBoundsException

import java.util.LinkedList; //導入方法依賴的package包/類
/**
 * addAll with too large an index throws IOOBE
 */
public void testAddAll2_IndexOutOfBoundsException() {
    LinkedList l = new LinkedList();
    l.add(new Object());
    LinkedList m = new LinkedList();
    m.add(new Object());
    try {
        l.addAll(4,m);
        shouldThrow();
    } catch (IndexOutOfBoundsException success) {}
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:14,代碼來源:LinkedListTest.java

示例8: visibleRegionsForPlayer

import java.util.LinkedList; //導入方法依賴的package包/類
public LinkedList<Region> visibleRegionsForPlayer(Player player)
{
	LinkedList<Region> visibleRegions = new LinkedList<Region>();
	LinkedList<Region> ownedRegions = ownedRegionsByPlayer(player);
	
	visibleRegions.addAll(ownedRegions);
	
	for(Region region : ownedRegions)	
		for(Region neighbor : region.getNeighbors())
			if(!visibleRegions.contains(neighbor))
				visibleRegions.add(neighbor);

	return visibleRegions;
}
 
開發者ID:mbillig,項目名稱:RiskBots,代碼行數:15,代碼來源:Map.java

示例9: insert

import java.util.LinkedList; //導入方法依賴的package包/類
@Override
public void insert(String key, LinkedList<V> value) {
    if (key == null) {
        return;
    }
    key = trimLowercaseString(key);

    key = convertWordToT9(key);

    TrieNode<LinkedList<V>> crawler = root;
    for (int i = 0; i < key.length(); i++) {
        final char c = key.charAt(i);
        if (!crawler.containsChild(c)) {
            crawler = crawler.addChild(c);
        } else {
            crawler = crawler.getChild(c);
        }
    }
    crawler.setKey(true);

    if (crawler.getValue() == null) {
        crawler.setValue(new LinkedList<V>());
    }

    final LinkedList<V> valuesList = crawler.getValue();
    valuesList.addAll(value);

    crawler.setValue(valuesList);
}
 
開發者ID:arunkumar9t2,項目名稱:trie,代碼行數:30,代碼來源:T9Trie.java

示例10: getWorkflowsInternal

import java.util.LinkedList; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private List<WorkflowInstance> getWorkflowsInternal(WorkflowInstanceQuery workflowInstanceQuery, boolean isActive, int maxItems, int skipCount)
{
    // MNT-9074 My Tasks fails to render if tasks quantity is excessive
    HistoricProcessInstanceQuery query = createQuery(workflowInstanceQuery, isActive);

    LinkedList<WorkflowInstance> results = new LinkedList<WorkflowInstance>();

    List<HistoricProcessInstance> completedInstances;
    if (maxItems > 0)
    {
        completedInstances = query.orderByProcessInstanceDuration().desc().listPage(skipCount, maxItems);
    }
    else
    {
        completedInstances = query.list();
    }

    List<WorkflowInstance> completedResults = typeConverter.doSpecialTenantFilterAndSafeConvert(completedInstances, new Function<HistoricProcessInstance, String>()
    {
        public String apply(HistoricProcessInstance historicProcessInstance)
        {
            ProcessDefinition procDef = activitiUtil.getProcessDefinition(historicProcessInstance.getProcessDefinitionId());
            return procDef.getKey();
        }
    });

    results.addAll(completedResults);
    return results;
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:31,代碼來源:ActivitiWorkflowEngine.java

示例11: createConnection

import java.util.LinkedList; //導入方法依賴的package包/類
private <T extends Connection> T createConnection ( final EClass connectionClass, final Class<T> clazz, final Global global, final Local local )
{
    final T connection = clazz.cast ( OsgiFactory.eINSTANCE.create ( connectionClass ) );

    final String tag = connection.getTypeTag ();

    final String cname = String.format ( "global.%s.to.%s.%s", Names.makeName ( global.getGlobal () ), local.getId (), tag );
    connection.setName ( cname );

    // set credentials
    connection.setCredentials ( EcoreUtil.copy ( findCredentials ( global, local ) ) );

    // add connection to "from"
    global.getGlobal ().getConnections ().add ( connection );

    // point connection to "to"
    final LinkedList<Endpoint> endpoints = new LinkedList<> ();
    for ( final Exporter exporter : local.getLocal ().getExporter () )
    {
        endpoints.addAll ( connection.getPossibleEndpoints ( exporter ) );
    }

    if ( endpoints.isEmpty () )
    {
        throw new IllegalStateException ( String.format ( "Unable to find an exporter that could serve as endpoint for connection type %s on master %s", connectionClass.getName (), local.getLocal ().getName () ) );
    }

    final Endpoint endpoint = endpoints.getFirst ();
    connection.setEndpoint ( endpoint );

    // FIXME: adding connection analyzers to "app", in phase 1

    return connection;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:35,代碼來源:GlobalizationProcessor.java

示例12: copy

import java.util.LinkedList; //導入方法依賴的package包/類
public void copy(StructExprRecog structExprRecog)    {
    mbarrayBiValues = structExprRecog.mbarrayBiValues;
    mnExprRecogType = structExprRecog.mnExprRecogType;
    mType = structExprRecog.mType;
    mstrFont = structExprRecog.mstrFont;
    LinkedList<StructExprRecog> listChildren = new LinkedList<StructExprRecog>();
    listChildren.addAll(structExprRecog.mlistChildren);
    mlistChildren = listChildren;
    mnLeft = structExprRecog.mnLeft;
    mnTop = structExprRecog.mnTop;
    mnWidth = structExprRecog.mnWidth;
    mnHeight = structExprRecog.mnHeight;
    mimgChop = structExprRecog.mimgChop;
    mdSimilarity = structExprRecog.mdSimilarity;
}
 
開發者ID:woshiwpa,項目名稱:CoreMathImgProc,代碼行數:16,代碼來源:StructExprRecog.java

示例13: getStats

import java.util.LinkedList; //導入方法依賴的package包/類
public String getStats() {
  	StringBuilder sb = new StringBuilder();
  	int pNodes = 0;
  	int cNodes = 0;
  	int mNodes = 0;
  	
  	LinkedList<Node> worklist = new LinkedList<Node>();
  	worklist.add(this);
  	Node curNode;
  	
  	while (!worklist.isEmpty()) {
  		curNode = worklist.poll();
  		worklist.addAll(curNode.childs);

  		for (Node n: curNode.childs) {
   		if (n instanceof PackageNode)
   			pNodes++;
   		else if (n instanceof ClassNode)
   			cNodes++;
   		else if (n instanceof MethodNode)
   			mNodes++;
   	}
  	}
  	
  	sb.append("Node stats:\n");
sb.append(Utils.INDENT + "- contains " + mNodes   + " method hashes.\n");
sb.append(Utils.INDENT + "- contains " + cNodes    + " clazz hashes.\n");
sb.append(Utils.INDENT + "- contains " + pNodes + " package hashes.");

  	return sb.toString();
  }
 
開發者ID:reddr,項目名稱:LibScout,代碼行數:32,代碼來源:HashTree.java

示例14: classlist

import java.util.LinkedList; //導入方法依賴的package包/類
public static LinkedList<String> classlist() {

		LinkedList<String> clist = new LinkedList<String>();
		ArrayList<String> paths = new ArrayList<String>();

		String cpath = System.getProperty("java.class.path");
		// System.out.println( "From Etomica plugin: java.class.path = " + cpath
		// );
		StringTokenizer tz = new StringTokenizer(cpath, PATHSEP);
		while (tz.hasMoreTokens()) {
			paths.add(tz.nextToken());
		}
		for (int i = 0; i < paths.size(); i++) {
			File file = new File(paths.get(i));
			if (file.isDirectory()) {
				if (!processDirectory(file, file.getAbsolutePath()).isEmpty())
					clist.addAll(processDirectory(file, file
									.getAbsolutePath()));
			} else {
				if (!processJar(file, file.getAbsolutePath()).isEmpty())
					clist.addAll(processJar(file, file.getAbsolutePath()));
			}

		}

		return clist;
	}
 
開發者ID:etomica,項目名稱:etomica,代碼行數:28,代碼來源:Lister.java

示例15: getWarnings

import java.util.LinkedList; //導入方法依賴的package包/類
@Override
public List<PlotConfigurationError> getWarnings() {
	LinkedList<PlotConfigurationError> warnings = new LinkedList<PlotConfigurationError>();

	warnings.addAll(groupedMasterDimensionConfig.getWarnings());
	if (warnings.size() > 0) {
		return warnings;
	}
	warnings.addAll(ungroupedMasterDimensionConfig.getWarnings());

	return warnings;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:13,代碼來源:DomainConfigManager.java


注:本文中的java.util.LinkedList.addAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。