当前位置: 首页>>代码示例>>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;未经允许,请勿转载。