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


Java TIntArrayList.isEmpty方法代碼示例

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


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

示例1: parseOptionalRangeList

import gnu.trove.list.array.TIntArrayList; //導入方法依賴的package包/類
/**
 * Parse either a range list in <>'s or nothing.
 * <pre>
 * OptionalRangeList ::=     '<' RangeList '>'
 *                   ::=
 * </pre>
 * @param bits
 * @return
 */
private boolean parseOptionalRangeList(TIntArrayList bits)
{
    if (lexer.getCode() != TGLexer.TokKind.less)
        return false;

    SourceMgr.SMLoc startLoc = lexer.getLoc();
    lexer.lex();    // Eat the '<'.

    parseRangeList(bits);
    if (bits.isEmpty()) return true;

    if (lexer.getCode() != TGLexer.TokKind.greater)
    {
        tokError("expected '>' at end of range list");
        return error(startLoc, "to match this '<'");
    }

    // Eat the '>'.
    lexer.lex();

    return false;
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:32,代碼來源:TGParser.java

示例2: parseOptionalBitList

import gnu.trove.list.array.TIntArrayList; //導入方法依賴的package包/類
/**
 * Parse either a bit list in {}'s or nothing.
 * <pre>
 *   OptionalBitList ::= '{' RangeList '}'
 *   OptionalBitList ::=
 * </pre>
 * @param bitlist
 * @return
 */
private boolean parseOptionalBitList(TIntArrayList bitlist)
{
    if (lexer.getCode() != TGLexer.TokKind.l_brace)
        return false;

    SourceMgr.SMLoc startLoc = lexer.getLoc();
    lexer.lex();

    parseRangeList(bitlist);
    if (bitlist.isEmpty()) return true;

    if (lexer.getCode() != TGLexer.TokKind.r_brace)
    {
        tokError("expected '}' at end of bit list");
        return error(startLoc, "to match this '{'");
    }

    lexer.lex();        // eat the '}'
    return false;
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:30,代碼來源:TGParser.java

示例3: isValid

import gnu.trove.list.array.TIntArrayList; //導入方法依賴的package包/類
@Override
public boolean isValid(UndirectedGraph<? extends TerminalExt, SwitchImpl> graph, TIntArrayList nodes, List<NodeTerminal> terminals) {
    return !nodes.isEmpty();
}
 
開發者ID:powsybl,項目名稱:powsybl-core,代碼行數:5,代碼來源:NodeBreakerVoltageLevel.java

示例4: combineChildVariants

import gnu.trove.list.array.TIntArrayList; //導入方法依賴的package包/類
/**
 * Given a bunch of permutations of each child of the
 * 'operator' node, put them together in all possible ways.
 * @param orig
 * @param childVariants
 * @param outVariants
 * @param cdp
 * @param depVars
 */
private static void combineChildVariants(TreePatternNode orig,
        ArrayList<ArrayList<TreePatternNode>> childVariants,
        ArrayList<TreePatternNode> outVariants,
        CodeGenDAGPatterns cdp,
        HashSet<String> depVars)
{
    for (int i = 0, e = childVariants.size(); i != e; i++)
    {
        if (childVariants.get(i).isEmpty())
            return;
    }

    TIntArrayList idxs = new TIntArrayList();
    idxs.fill(0, childVariants.size(),0);
    boolean notDone;
    do
    {
        if (TableGen.DEBUG && !idxs.isEmpty())
        {
            System.err.printf("%s: Idxs = [ ", orig.getOperator().getName());
            for (int i = 0, e = idxs.size(); i != e; i++)
                System.err.printf("%d ", idxs.get(i));

            System.err.println("]");
        }

        ArrayList<TreePatternNode> newChildren = new ArrayList<>();
        for (int i = 0, e = childVariants.size(); i != e; i++)
            newChildren.add(childVariants.get(i).get(idxs.get(i)));

        TreePatternNode r = new TreePatternNode(orig.getOperator(), newChildren);

        r.setName(orig.getName());
        r.setPredicateFns(orig.getPredicateFns());
        r.setTransformFn(orig.getTransformFn());
        r.setTypes(orig.getExtTypes());

        StringBuilder errString = new StringBuilder();
        if (r.canPatternMatch(errString, cdp))
        {
            boolean alreadyExists = false;
            for (int i = 0, e = outVariants.size(); i != e; i++)
            {
                if (r.isIsomorphicTo(outVariants.get(i), depVars))
                {
                    alreadyExists = true;
                    break;
                }
            }

            if (!alreadyExists)
                outVariants.add(r);
        }

        // Increment indices to the next permutation by incrementing the
        // indicies from last index backward, e.g., generate the sequence
        // [0, 0], [0, 1], [1, 0], [1, 1].
        int j;
        for (j = idxs.size() - 1; j >= 0; --j)
        {
            int tmp = idxs.get(j);
            idxs.set(j, tmp + 1);
            if (tmp + 1 == childVariants.get(j).size())
                idxs.set(j, 0);
            else
                break;
        }
        notDone = j >= 0;
    }while (notDone);
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:80,代碼來源:CodeGenDAGPatterns.java


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