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


Java LinkedList.size方法代碼示例

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


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

示例1: replaceChildren

import java.util.LinkedList; //導入方法依賴的package包/類
@Override
public AbstractExpr replaceChildren(LinkedList<PatternExprUnitMap> listFromToMap, boolean bExpr2Pattern, LinkedList<AbstractExpr> listReplacedChildren) throws JFCALCExpErrException, JSmartMathErrException	{
	AEMulDivOpt aeReturn = new AEMulDivOpt();
       aeReturn.copy(this);
       for (int idx = 0; idx < aeReturn.mlistChildren.size(); idx ++)	{
		for (int idx1 = 0; idx1 < listFromToMap.size(); idx1 ++)	{
			if (bExpr2Pattern && aeReturn.mlistChildren.get(idx).isEqual(listFromToMap.get(idx1).maeExprUnit))	{
				aeReturn.mlistChildren.set(idx, listFromToMap.get(idx1).maePatternUnit);	// need to clone because will be many aeTo copies. To make it simple, not clone.
				listReplacedChildren.add(aeReturn.mlistChildren.get(idx));
				break;
			} else if ((!bExpr2Pattern) && aeReturn.mlistChildren.get(idx).isEqual(listFromToMap.get(idx1).maePatternUnit))	{
				aeReturn.mlistChildren.set(idx, listFromToMap.get(idx1).maeExprUnit);	// need to clone because will be many aeTo copies. To make it simple, not clone.
				listReplacedChildren.add(aeReturn.mlistChildren.get(idx));
				break;
			}
		}
	}
	return aeReturn;
}
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:20,代碼來源:AEMulDivOpt.java

示例2: validate

import java.util.LinkedList; //導入方法依賴的package包/類
/**
 * Overall validation
 * @param value Value to validate
 * @throws OverallValidationException If validation fails
 */
protected void validate(PropertyBox value) throws OverallValidationException {

	LinkedList<ValidationException> failures = new LinkedList<>();
	for (Validator<PropertyBox> validator : getValidators()) {
		try {
			validator.validate(value);
		} catch (ValidationException ve) {
			failures.add(ve);
			if (isStopOverallValidationAtFirstFailure()) {
				break;
			}
		}
	}

	// collect validation exceptions, if any
	if (!failures.isEmpty()) {

		OverallValidationException validationException = (failures.size() == 1)
				? new OverallValidationException(failures.getFirst().getMessage(),
						failures.getFirst().getMessageCode(), failures.getFirst().getMessageArguments())
				: new OverallValidationException(failures.toArray(new ValidationException[failures.size()]));

		// notify validation status
		notifyInvalidValidationStatus(validationException, getOverallValueComponent().orElse(null), null);

		throw validationException;
	}

	// notify validation status
	notifyValidValidationStatus(getOverallValueComponent().orElse(null), null);
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin7,代碼行數:37,代碼來源:DefaultPropertyInputGroup.java

示例3: getDayOfWeek

import java.util.LinkedList; //導入方法依賴的package包/類
public static DataClass getDayOfWeek(LinkedList<DataClass> listParams) throws JFCALCExpErrException {
    if (listParams.size() != 1)   {
        throw new JFCALCExpErrException(ERRORTYPES.ERROR_INCORRECT_NUM_OF_PARAMETER);
    }
    DataClass datumTS = new DataClass();
    datumTS.copyTypeValueDeep(listParams.removeLast());
    datumTS.changeDataType(DATATYPES.DATUM_INTEGER);
    long lTS = datumTS.getDataValue().longValue();
    Calendar cal = Calendar.getInstance();
    cal.setTimeInMillis(lTS);
    int nReturn = cal.get(Calendar.DAY_OF_WEEK);
    int nDayOfWeek = 0;
    switch (nReturn) {
        case (Calendar.SUNDAY): {
            nDayOfWeek = 0;
            break;
        } case (Calendar.MONDAY): {
            nDayOfWeek = 1;
            break;
        } case (Calendar.TUESDAY): {
            nDayOfWeek = 2;
            break;
        } case (Calendar.WEDNESDAY): {
            nDayOfWeek = 3;
            break;
        } case (Calendar.THURSDAY): {
            nDayOfWeek = 4;
            break;
        } case (Calendar.FRIDAY): {
            nDayOfWeek = 5;
            break;
        } case (Calendar.SATURDAY): {
            nDayOfWeek = 6;
            break;
        }
    }
    return new DataClass(DATATYPES.DATUM_INTEGER, new MFPNumeric(nDayOfWeek));
}
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:39,代碼來源:MFPDateTime.java

示例4: addRecentCache

import java.util.LinkedList; //導入方法依賴的package包/類
private static void addRecentCache(Context context, Author... authors) {
    final LinkedList<Author> localCache = getRecentCache(context);

    // 避免重複添加
    for (Author author : authors) {
        if (author == null
                || author.getId() <= 0
                || TextUtils.isEmpty(author.getName())
                || author.getId() == AccountHelper.getUserId())
            continue;
        if (checkInContacts(localCache, author)) {
            // 移除後添加到頭部
            int index = indexOfContacts(localCache, author);
            if (index >= 0) {
                localCache.remove(index);
                localCache.addFirst(author);
            }
        } else {
            localCache.addFirst(author);
        }
    }

    // 至多存儲15條
    while (localCache.size() > 10) {
        localCache.removeLast();
    }

    CacheManager.saveToJson(context, RECENT_CACHE_FILE, localCache);
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:30,代碼來源:ContactsCacheManager.java

示例5: getChassisEthernetPortIndexs

import java.util.LinkedList; //導入方法依賴的package包/類
public int[] getChassisEthernetPortIndexs(ConsoleAccess telnet)
        throws IOException, ConsoleException, AbortedException {
    LinkedList<Integer> list = new LinkedList<Integer>();

    for (Integer i : ethernetPorts) {
        if ((new ShowEther(telnet, i).isPresence()) == 1) {
            list.add(i);
        }
    }

    int[] idx = new int[list.size()];

    for (int i = 0; i < list.size(); i++) {
        idx[i] = list.get(i).intValue();
    }

    return idx;
}
 
開發者ID:openNaEF,項目名稱:openNaEF,代碼行數:19,代碼來源:EXAtraxTelnetUtil.java

示例6: getDayOfYear

import java.util.LinkedList; //導入方法依賴的package包/類
public static DataClass getDayOfYear(LinkedList<DataClass> listParams) throws JFCALCExpErrException {
    if (listParams.size() != 1)   {
        throw new JFCALCExpErrException(ERRORTYPES.ERROR_INCORRECT_NUM_OF_PARAMETER);
    }
    DataClass datumTS = new DataClass();
    datumTS.copyTypeValueDeep(listParams.removeLast());
    datumTS.changeDataType(DATATYPES.DATUM_INTEGER);
    long lTS = datumTS.getDataValue().longValue();
    Calendar cal = Calendar.getInstance();
    cal.setTimeInMillis(lTS);
    int nReturn = cal.get(Calendar.DAY_OF_YEAR);
    return new DataClass(DATATYPES.DATUM_INTEGER, new MFPNumeric(nReturn));
}
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:14,代碼來源:MFPDateTime.java

示例7: filterusersByOffice

import java.util.LinkedList; //導入方法依賴的package包/類
private LinkedList<QUser> filterusersByOffice(LinkedList<QUser> AllUsers) {
    LinkedList<QUser> Nusers = new LinkedList<QUser>();
    if (isLogin()) {
        Long userId = user.getUser().getId();
        QUser quser = QUserList.getInstance().getById(userId);
        for (int i = 0; i < AllUsers.size(); i++) {

            if (AllUsers.get(i).getOffice().getId() == quser.getOffice().getId()) {
                Nusers.add(AllUsers.get(i));
            }
        }
    }

    return Nusers;
}
 
開發者ID:bcgov,項目名稱:sbc-qsystem,代碼行數:16,代碼來源:Form.java

示例8: copySetListOfChildren

import java.util.LinkedList; //導入方法依賴的package包/類
@Override
public AbstractExpr copySetListOfChildren(LinkedList<AbstractExpr> listChildren)  throws JFCALCExpErrException, JSmartMathErrException {
    if (listChildren == null || listChildren.size() != 1) {
        throw new JSmartMathErrException(ERRORTYPES.ERROR_INVALID_ABSTRACTEXPR);			
    }
    AEUnaryOpt aeReturn = new AEUnaryOpt();
    aeReturn.copy(this);
    aeReturn.maexprChild = listChildren.getFirst();
    aeReturn.validateAbstractExpr();
    return aeReturn;
}
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:12,代碼來源:AEUnaryOpt.java

示例9: removeCardsByIDs

import java.util.LinkedList; //導入方法依賴的package包/類
@Override
public void removeCardsByIDs(LinkedList<Integer> ids) {
	for (int i = 0; i < cards.size(); i++) {
		Card card = cards.get(i);
		
		for(int j = 0; j < ids.size(); j++){
			if(card.getID() == ids.get(j)){
				cards.remove(i);
				break;
			}
		}
	}

}
 
開發者ID:Ativelox,項目名稱:Rummy,代碼行數:15,代碼來源:Hand.java

示例10: findNode

import java.util.LinkedList; //導入方法依賴的package包/類
/**
 * Method used to find a node according to its Gorn address
 */
public void findNode(Node n, String address, List<Node> ln) {
    TagNode nn = (TagNode) n;
    if (nn.getAddress().equals(address)) {
        ln.add(n);
    } else {
        if (n.getChildren() != null) {
            LinkedList<Node> l = (LinkedList<Node>) n.getChildren();
            for (int i = 0; i < l.size(); i++) {
                findNode(l.get(i), address, ln);
            }
        }
    }
}
 
開發者ID:spetitjean,項目名稱:TuLiPA-frames,代碼行數:17,代碼來源:TagTree.java

示例11: processOptions

import java.util.LinkedList; //導入方法依賴的package包/類
@Override
protected void processOptions(LinkedList<String> args) throws IOException {
  if (args.size() != 3) {
    throw new IllegalArgumentException("Incorrect number of arguments.");
  }
  newName = args.removeLast();
  oldName = args.removeLast();
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:9,代碼來源:SnapshotCommands.java

示例12: populateInputPads

import java.util.LinkedList; //導入方法依賴的package包/類
public void populateInputPads(LinkedList<TableInputPad> listInputPads)	{
	// load all the input pads.
	mlistInputPadViews.clear();
	mlistInputPadViewsLand.clear();
	for (int index = 0; index < listInputPads.size(); index ++)	{
		TableInputPad inputPad = listInputPads.get(index);
		View vInputPad = populateInputPad(inputPad, index, false);
		View vInputPadLand = populateInputPad(inputPad, index, true);
		if (vInputPad != null && vInputPadLand != null)	{
			mlistInputPadViews.add(vInputPad);
			mlistInputPadViewsLand.add(vInputPadLand);
		}
	}
}
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:15,代碼來源:ActivityCfgKeyPad.java

示例13: dump_stack

import java.util.LinkedList; //導入方法依賴的package包/類
public static void dump_stack(LinkedList<TraverseStackNode> stack, String prefix) {
  int size = stack.size();
  System.out.println(prefix + "lasting traverse stack size (" + size + ")");
  for (int i = 0; i < size; i++) {
    System.out.println(prefix + "(" + (size - i - 1) + ") " + stack.get(i));
  }
}
 
開發者ID:Samsung,項目名稱:MeziLang,代碼行數:8,代碼來源:TraverseStackNode.java

示例14: validateInputs

import java.util.LinkedList; //導入方法依賴的package包/類
/**
 * Validate all the {@link Input}s.
 * @throws ValidationException If one or more input is not valid
 */
private void validateInputs() throws ValidationException {

	LinkedList<ValidationException> failures = new LinkedList<>();

	// get all property configurations
	List<PropertyConfiguration<?>> configurations = propertySet.stream().map(p -> _propertyConfiguration(p))
			.filter(cfg -> !cfg.isReadOnly() && !cfg.isHidden() && cfg.getInput().isPresent())
			.collect(Collectors.toList());

	if (configurations != null) {

		if (isStopValidationAtFirstFailure()) {
			// reset validation status
			configurations.forEach(c -> resetValidationStatus(c.getInput().get(), c.getProperty()));
		}

		for (PropertyConfiguration<?> configuration : configurations) {
			try {
				validateProperty(configuration);
			} catch (ValidationException e) {
				failures.add(e);

				if (isStopValidationAtFirstFailure()) {
					// break if stop validation at first failure
					break;
				}
			}
		}
	}

	// collect validation exceptions, if any
	if (!failures.isEmpty()) {
		if (failures.size() == 1) {
			throw failures.getFirst();
		} else {
			throw new ValidationException(failures.toArray(new ValidationException[0]));
		}
	}
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin,代碼行數:44,代碼來源:DefaultPropertyInputGroup.java

示例15: createPath

import java.util.LinkedList; //導入方法依賴的package包/類
/** Find a path (by name) from one node to the root or a parent.
 * @param node the node to start in
 * @param parent parent node to stop in (can be <code>null</code> for the root)
 * @return list of child names--i.e. a path from the parent to the child node
 * @exception IllegalArgumentException if <code>node</code>'s getName()
 * method returns <code>null</code>
 */
public static String[] createPath(Node node, Node parent) {
    LinkedList<String> ar = new LinkedList<String>();

    while ((node != null) && (node != parent)) {
        if (node.getName() == null) {
            boolean isFilter = false;

            if (node instanceof FilterNode) {
                isFilter = true;
            }

            throw new IllegalArgumentException(
                "Node:" + node.getClass() // NOI18N
                 +"[" + node.getDisplayName() + "]" // NOI18N
                 +(isFilter ? (" of original:" + ((FilterNode) node).getOriginal().getClass()) : "") // NOI18N
                 +" gets null name!"
            ); // NOI18N
        }

        ar.addFirst(node.getName());
        node = node.getParentNode();
    }

    String[] res = new String[ar.size()];
    ar.toArray(res);

    return res;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:36,代碼來源:NodeOp.java


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