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


Java LinkedList.add方法代码示例

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


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

示例1: readList

import java.util.LinkedList; //导入方法依赖的package包/类
private LinkedList<String> readList(Document xml) {
    LinkedList<String> list = new LinkedList<>();
    
    Element root = (Element) xml.getElementsByTagName(rootTagName).item(0);
    
    NodeList nlItems = root.getElementsByTagName(elementTagName);
    for (int i = 0; i < nlItems.getLength(); ++i) {
        Node nListItem = nlItems.item(i);
        if (nListItem.getNodeType() != Node.ELEMENT_NODE) {
            continue;
        }
        
        list.add(nListItem.getTextContent());
    }
    
    return list;
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:18,代码来源:XmlStringList.java

示例2: sel

import java.util.LinkedList; //导入方法依赖的package包/类
public List<Object> sel(String xpath) throws XpathSyntaxErrorException {
    LinkedList res = new LinkedList();

    try {
        List e = this.xpathEva.xpathParser(xpath, this.elements);
        Iterator msg1 = e.iterator();

        while(msg1.hasNext()) {
            JXNode j = (JXNode)msg1.next();
            if(j.isText()) {
                res.add(j.getTextVal());
            } else {
                res.add(j.getElement());
            }
        }

        return res;
    } catch (Exception var6) {
        String msg = "please check the xpath syntax";
        if(var6 instanceof NoSuchAxisException || var6 instanceof NoSuchFunctionException) {
            msg = var6.getMessage();
        }

        throw new XpathSyntaxErrorException(msg);
    }
}
 
开发者ID:jtduan,项目名称:common-spider,代码行数:27,代码来源:XDocument.java

示例3: getRepositories

import java.util.LinkedList; //导入方法依赖的package包/类
/**
 * Returns all repositories for the connector with the given ID
 * 
 * @param connectorID
 * @return 
 */
public Collection<RepositoryImpl> getRepositories(String connectorID, boolean allKnown) {
    LinkedList<RepositoryImpl> ret = new LinkedList<RepositoryImpl>();
    lockRepositories();        
    try {
        final Map<String, RepositoryImpl> m = repositories.get(connectorID);
        if(m != null) {
            ret.addAll(m.values());
        } 
    } finally {
        releaseRepositoriesLock();
    }
    if(allKnown) {
        // team repos (not registered by user)
        Collection<RepositoryImpl> repos = TeamRepositories.getInstance().getRepositories(false, true);
        for (RepositoryImpl impl : repos) {
            if(connectorID.equals(impl.getConnectorId())) {
                ret.add(impl);
            }
        }
    }
    return ret;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:RepositoryRegistry.java

示例4: pattern_PositionPointLink_2_3_findcontext_blackBBBBBBBB

import java.util.LinkedList; //导入方法依赖的package包/类
public static final Iterable<Object[]> pattern_PositionPointLink_2_3_findcontext_blackBBBBBBBB(Location srcLocation,
		LocationToLocation locationToLocation, PositionPoint positionPoint,
		outageDetectionJointarget.PositionPoint trgPositionPoint, outageDetectionJointarget.Location trgLocation,
		MeterAssetPhysicalDevicePair pair, MeterAsset asset, PositionPointToPositionPoint positionCorr) {
	LinkedList<Object[]> _result = new LinkedList<Object[]>();
	if (trgLocation.equals(locationToLocation.getTarget())) {
		if (asset.equals(pair.getA())) {
			if (srcLocation.equals(locationToLocation.getSource())) {
				if (srcLocation.equals(asset.getLocation())) {
					if (positionPoint.equals(srcLocation.getPosition())) {
						if (trgPositionPoint.equals(positionCorr.getTarget())) {
							if (positionPoint.equals(positionCorr.getSource())) {
								_result.add(new Object[] { srcLocation, locationToLocation, positionPoint,
										trgPositionPoint, trgLocation, pair, asset, positionCorr });
							}
						}
					}
				}
			}
		}
	}
	return _result;
}
 
开发者ID:SvenPeldszus,项目名称:rgse.ttc17.emoflon.tgg,代码行数:24,代码来源:PositionPointLinkImpl.java

示例5: listUnitsInSystem

import java.util.LinkedList; //导入方法依赖的package包/类
public static LinkedList<String> listUnitsInSystem(String unitSystem){
	LinkedList<String> unitList = listUnits();
	LinkedList<String> unitsInSystem = new LinkedList<String>();
	
	try {
		UnitSystem us = UnitFilter.stringToUnitSystem(unitSystem);
		Class c = us.getClass();
		Method[] methodSet = c.getDeclaredMethods();
		for (int i=0; i<methodSet.length;i++){
			String s = methodSet[i].invoke(us).getClass().getName();
			//System.out.println(s);
			if (unitList.contains(s)){
				unitsInSystem.add(s);
			}
		}
	} catch (Throwable er) {
		//System.err.println(er);
	}
	/*for(Iterator e = unitsInSystem.iterator(); e.hasNext();){
		System.out.println(e.next().toString());
	}*/
	return unitsInSystem;
}
 
开发者ID:etomica,项目名称:etomica,代码行数:24,代码来源:Lister.java

示例6: inviteCustomer

import java.util.LinkedList; //导入方法依赖的package包/类
@Override
public void inviteCustomer(QUser user, QCustomer customer) {
    forBlink.add(user);
    forShow.remove(user);
    forShow.add(user);

    if (!timer.isRunning()) {
        timer.start();
        if (flag) {
            //todo      board.showData(forShow, forBlink);
        }
        flag = false;
    }

    LinkedList<String> nests = new LinkedList<>();
    for (QService service : QServiceTree.getInstance().getNodes()) {
        if (service.isLeaf()) {
            QCustomer customer_next = service.peekCustomer();
            if (customer_next != null) {
                nests.add(customer_next.getPrefix() + customer_next.getNumber());
            }
        }
    }
    //todo  board.showNextCustomers(nests);
}
 
开发者ID:bcgov,项目名称:sbc-qsystem,代码行数:26,代码来源:OrangeMainboardImpl.java

示例7: pattern_LocationLink_10_2_testcorematchandDECs_blackFFFB

import java.util.LinkedList; //导入方法依赖的package包/类
public static final Iterable<Object[]> pattern_LocationLink_10_2_testcorematchandDECs_blackFFFB(
		EMoflonEdge _edge_Location) {
	LinkedList<Object[]> _result = new LinkedList<Object[]>();
	EObject tmpAsset = _edge_Location.getSrc();
	if (tmpAsset instanceof MeterAsset) {
		MeterAsset asset = (MeterAsset) tmpAsset;
		EObject tmpLocation = _edge_Location.getTrg();
		if (tmpLocation instanceof Location) {
			Location location = (Location) tmpLocation;
			if (location.equals(asset.getLocation())) {
				for (MeterAssetMMXUPair pair : org.moflon.core.utilities.eMoflonEMFUtil
						.getOppositeReferenceTyped(asset, MeterAssetMMXUPair.class, "a")) {
					_result.add(new Object[] { pair, asset, location, _edge_Location });
				}
			}
		}

	}

	return _result;
}
 
开发者ID:SvenPeldszus,项目名称:rgse.ttc17.emoflon.tgg,代码行数:22,代码来源:LocationLinkImpl.java

示例8: mapNetwork

import java.util.LinkedList; //导入方法依赖的package包/类
@Override
public boolean mapNetwork(SubstrateNetwork network, VirtualNetwork vNetwork) {
	List<VirtualNetwork> vns = new LinkedList<VirtualNetwork>();
	vns.add(vNetwork);
	NetworkStack stack = new NetworkStack(network, vns);
	LinkedList<IHiddenHopMapping> hhMappings = new LinkedList<IHiddenHopMapping>();
	double hiddenHopsFactor = 0;
	hhMappings.add(new BandwidthCpuHiddenHopMapping(hiddenHopsFactor));

	AlgorithmParameter param = new AlgorithmParameter();
	param.put("kShortestPath", "50");
	param.put("distance", "35");
	param.put("PathSplitting", "false");
	param.put("eppstein", "false");
	GenericMappingAlgorithm algo = new AvailableResources(param);
	algo.setStack(stack);
	if (algo instanceof GenericMappingAlgorithm)
		((GenericMappingAlgorithm) algo).setHhMappings(hhMappings);

	algo.performEvaluation();
	return VnrUtils.isMapped(vNetwork);

}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:24,代码来源:RWMMSP.java

示例9: processPathShowQuotasHuman

import java.util.LinkedList; //导入方法依赖的package包/类
@Test
public void processPathShowQuotasHuman() throws Exception {
  Path path = new Path("mockfs:/test");

  when(mockFs.getFileStatus(eq(path))).thenReturn(fileStat);
  PathData pathData = new PathData(path.toString(), conf);

  PrintStream out = mock(PrintStream.class);

  Count count = new Count();
  count.out = out;

  LinkedList<String> options = new LinkedList<String>();
  options.add("-q");
  options.add("-h");
  options.add("dummy");
  count.processOptions(options);

  count.processPath(pathData);
  verify(out).println(HUMAN + WITH_QUOTAS + path.toString());
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:22,代码来源:TestCount.java

示例10: getChargingCollectionFunctionAddresses

import java.util.LinkedList; //导入方法依赖的package包/类
/**
 * <p>Get all the Charging Collection Function (CCF) Addresses set in this header</p>
 *
 * @return ListIterator that constains all CCF addresses of this header
 */
public ListIterator getChargingCollectionFunctionAddresses() {

    Iterator li = this.parameters.iterator();
    LinkedList ccfLIST = new LinkedList();
    NameValue nv;
    while (li.hasNext()) {
        nv = (NameValue) li.next();
        if (nv.getName().equalsIgnoreCase(ParameterNamesIms.CCF)) {

            NameValue ccfNV = new NameValue();

            ccfNV.setName(nv.getName());
            ccfNV.setValueAsObject(nv.getValueAsObject());

            ccfLIST.add(ccfNV);

        }
    }

    return ccfLIST.listIterator();
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:27,代码来源:PChargingFunctionAddresses.java

示例11: pattern_LocationLink_2_2_corematch_blackFBBFFBFB

import java.util.LinkedList; //导入方法依赖的package包/类
public static final Iterable<Object[]> pattern_LocationLink_2_2_corematch_blackFBBFFBFB(MeterAsset asset,
		Location location, MeterAssetPhysicalDevicePair pair, Match match) {
	LinkedList<Object[]> _result = new LinkedList<Object[]>();
	for (MeterAssetToEnergyConsumer assetToConumer : org.moflon.core.utilities.eMoflonEMFUtil
			.getOppositeReferenceTyped(asset, MeterAssetToEnergyConsumer.class, "source")) {
		EnergyConsumer consumer = assetToConumer.getTarget();
		if (consumer != null) {
			for (LocationToLocation locationCorr : org.moflon.core.utilities.eMoflonEMFUtil
					.getOppositeReferenceTyped(location, LocationToLocation.class, "source")) {
				outageDetectionJointarget.Location trgLocation = locationCorr.getTarget();
				if (trgLocation != null) {
					_result.add(new Object[] { consumer, asset, location, assetToConumer, trgLocation, pair,
							locationCorr, match });
				}

			}
		}

	}
	return _result;
}
 
开发者ID:SvenPeldszus,项目名称:rgse.ttc17.emoflon.tgg,代码行数:22,代码来源:LocationLinkImpl.java

示例12: checkAnnotationViolations

import java.util.LinkedList; //导入方法依赖的package包/类
public <T> List<LicenseViolation> checkAnnotationViolations(T obj, List<Product> products) {
    LinkedList causes = new LinkedList();
    if(!this.isAllowedByAnnotations(obj, products)) {
        List licenseLevelAnnotations = this.getLicenseAnnotations(obj, LicenseLevel.class);
        Iterator constraintAnnotations = licenseLevelAnnotations.iterator();

        while(constraintAnnotations.hasNext()) {
            LicenseLevel annotation = (LicenseLevel)constraintAnnotations.next();
            if(!this.isAllowedByLicenseLevel(annotation, products)) {
                License annotation1 = null;

                try {
                    annotation1 = this.getActiveLicense(annotation.productId(), products);
                } catch (UnknownProductException var9) {
                    ;
                }

                causes.add(new LicenseLevelViolation(obj, annotation1, annotation));
            }
        }

        List constraintAnnotations1 = this.getLicenseAnnotations(obj, LicenseConstraint.class);
        Iterator annotation2 = constraintAnnotations1.iterator();

        while(annotation2.hasNext()) {
            LicenseConstraint annotation3 = (LicenseConstraint)annotation2.next();
            this.checkForLicenseConstraintViolation(products, causes, annotation3);
        }
    }

    return causes;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:33,代码来源:LicenseAnnotationValidator.java

示例13: rules

import java.util.LinkedList; //导入方法依赖的package包/类
public void rules ()
{
    this.readLock.lock ();
    try
    {
        final List<String> header = Arrays.asList ( "Prio", "ID", "Realized", "Error" );
        final List<List<String>> data = new LinkedList<> ();

        for ( final Entry entry : this.entries )
        {
            final LinkedList<String> row = new LinkedList<> ();
            row.add ( "" + entry.priority );
            row.add ( entry.id );
            row.add ( entry.isRealized () ? "X" : "" );
            if ( entry.error != null )
            {
                row.add ( ExceptionHelper.getMessage ( entry.error ) );
            }
            else
            {
                row.add ( "" );
            }
            data.add ( row );
        }

        // will be redirected by the gogo shell
        Tables.showTable ( System.out, header, data, 1 );
    }
    finally
    {
        this.readLock.unlock ();
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:34,代码来源:EventInjectorImpl.java

示例14: searchAPI

import java.util.LinkedList; //导入方法依赖的package包/类
/**
 * Perform a query on a given UCL API connection and return an array of bookings.
 * @param conn UCLApiConnection
 * @param endpoint the API path
 * @param params hashtable of query parameters
 * @return Array of bookings
 */
public static Booking[] searchAPI(UCLApiConnection conn, String endpoint, Hashtable<String, String> params) {

    try {
        boolean cont = true;
        LinkedList<Booking> bookings = new LinkedList<Booking>();

        while (cont == true) {
            String response = conn.queryAPI(endpoint, params);
            JSONParser p = new JSONParser();
            JSONObject responseObject = (JSONObject)p.parse(response);

            JSONArray bs = (JSONArray)responseObject.get("bookings");

            int nBookings = bs.size();
            
            for (int i = 0; i < nBookings; i++) {
                bookings.add(new Booking((JSONObject)bs.get(i)));
            }

            cont = (boolean)responseObject.get("next_page_exists"); 
        
            if (cont) {
                params.put("page_token",(String)responseObject.get("page_token"));

            }
        }


        return bookings.toArray(new Booking[bookings.size()]);

    } catch (Exception e){
        System.err.println(e.toString());
        if (uclapi.UCLApiConnection.ExitOnException) {
            System.exit(5);
    }
    }
    return new Booking[0];
}
 
开发者ID:owainkenwayucl,项目名称:uclapi-java,代码行数:46,代码来源:Booking.java

示例15: isPatternMatch

import java.util.LinkedList; //导入方法依赖的package包/类
@Override
public boolean isPatternMatch(AbstractExpr aePattern,
                            LinkedList<PatternExprUnitMap> listpeuMapPseudoFuncs,
                            LinkedList<PatternExprUnitMap> listpeuMapPseudoConsts,
                            LinkedList<PatternExprUnitMap> listpeuMapUnknowns,
                            boolean bAllowConversion)  throws JFCALCExpErrException, JSmartMathErrException, InterruptedException    {
    /* do not call isPatternDegrade function because generally compare expression cannot degrade-match a pattern.*/
    if (aePattern.menumAEType == ABSTRACTEXPRTYPES.ABSTRACTEXPR_VARIABLE)   {
        // unknown variable
        for (int idx = 0; idx < listpeuMapUnknowns.size(); idx ++)  {
            if (listpeuMapUnknowns.get(idx).maePatternUnit.isEqual(aePattern))    {
                if (isEqual(listpeuMapUnknowns.get(idx).maeExprUnit))   {
                    // this unknown variable has been mapped to an expression and the expression is the same as this
                    return true;
                } else  {
                    // this unknown variable has been mapped to an expression but the expression is not the same as this
                    return false;
                }
            }
        }
        // the aePattern is an unknown variable and it hasn't been mapped to some expressions before.
        PatternExprUnitMap peuMap = new PatternExprUnitMap(this, aePattern);
        listpeuMapUnknowns.add(peuMap);
        return true;
    }
    if (!(aePattern instanceof AECompare))   {
        return false;
    }
    if (moptType != ((AECompare)aePattern).moptType) {
        return false;
    }
    if (maeLeft.isPatternMatch(((AECompare)aePattern).maeLeft, listpeuMapPseudoFuncs, listpeuMapPseudoConsts, listpeuMapUnknowns, bAllowConversion) == false) {
        return false;
    }
    if (maeRight.isPatternMatch(((AECompare)aePattern).maeRight, listpeuMapPseudoFuncs, listpeuMapPseudoConsts, listpeuMapUnknowns, bAllowConversion) == false) {
        return false;
    }
    
    return true;
}
 
开发者ID:woshiwpa,项目名称:SmartMath,代码行数:41,代码来源:AECompare.java


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