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


Java TIntArrayList类代码示例

本文整理汇总了Java中gnu.trove.list.array.TIntArrayList的典型用法代码示例。如果您正苦于以下问题:Java TIntArrayList类的具体用法?Java TIntArrayList怎么用?Java TIntArrayList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: parseFieldName

import gnu.trove.list.array.TIntArrayList; //导入依赖的package包/类
static void parseFieldName(JsonParser parser, JsonParsingContext context) throws IOException {
    String fieldName = parser.getCurrentName();
    switch (fieldName) {
        case "offset":
            context.offset = parser.nextIntValue(-1);
            context.doubleValues = null;
            context.stringValues = null;
            break;
        case "uncompressedLength":
            context.uncompressedLength = parser.nextIntValue(-1);
            break;
        case "stepLengths":
            context.stepLengths = new TIntArrayList();
            context.valuesOrLengthArray = true;
            break;
        case "values":
        case "stepValues":
            context.valuesOrLengthArray = true;
            break;
        default:
            break;
    }
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:24,代码来源:ArrayChunk.java

示例2: getEdgeObjects

import gnu.trove.list.array.TIntArrayList; //导入依赖的package包/类
@Override
public List<E> getEdgeObjects(int v1, int v2) {
    checkVertex(v1);
    checkVertex(v2);
    List<E> edgeObjects = new ArrayList<>(1);
    TIntArrayList[] adjacencyList = getAdjacencyList();
    TIntArrayList adjacentEdges = adjacencyList[v1];
    for (int i = 0; i < adjacentEdges.size(); i++) {
        int e = adjacentEdges.getQuick(i);
        Edge<E> edge = edges.get(e);
        if ((edge.getV1() == v1 && edge.getV2() == v2)
            || (edge.getV1() == v2 && edge.getV2() == v1)) {
            edgeObjects.add(edge.getObject());
        }
    }
    return edgeObjects;
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:18,代码来源:UndirectedGraphImpl.java

示例3: traverse

import gnu.trove.list.array.TIntArrayList; //导入依赖的package包/类
@Override
public void traverse(int v, Traverser<E> traverser, boolean[] encountered) {
    checkVertex(v);
    TIntArrayList[] adjacencyList = getAdjacencyList();
    TIntArrayList adjacentEdges = adjacencyList[v];
    encountered[v] = true;
    for (int i = 0; i < adjacentEdges.size(); i++) {
        int e = adjacentEdges.getQuick(i);
        Edge<E> edge = edges.get(e);
        int v1 = edge.getV1();
        int v2 = edge.getV2();
        if (!encountered[v1]) {
            if (traverser.traverse(v2, e, v1) == TraverseResult.CONTINUE) {
                encountered[v1] = true;
                traverse(v1, traverser, encountered);
            }
        } else if (!encountered[v2] && traverser.traverse(v1, e, v2) == TraverseResult.CONTINUE) {
            encountered[v2] = true;
            traverse(v2, traverser, encountered);
        }
    }
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:23,代码来源:UndirectedGraphImpl.java

示例4: AbstractTapChanger

import gnu.trove.list.array.TIntArrayList; //导入依赖的package包/类
protected AbstractTapChanger(Ref<? extends MultiStateObject> network, H parent,
                             int lowTapPosition, List<S> steps, TerminalExt regulationTerminal,
                             int tapPosition, boolean regulating) {
    this.network = network;
    this.parent = parent;
    this.lowTapPosition = lowTapPosition;
    this.steps = steps;
    this.regulationTerminal = regulationTerminal;
    int stateArraySize = network.get().getStateManager().getStateArraySize();
    this.tapPosition = new TIntArrayList(stateArraySize);
    this.regulating = new BitSet(stateArraySize);
    this.regulating.set(0, stateArraySize, regulating);
    for (int i = 0; i < stateArraySize; i++) {
        this.tapPosition.add(tapPosition);
    }
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:17,代码来源:AbstractTapChanger.java

示例5: ConfiguredBusImpl

import gnu.trove.list.array.TIntArrayList; //导入依赖的package包/类
ConfiguredBusImpl(String id, VoltageLevelExt voltageLevel) {
    super(id, voltageLevel);
    network = voltageLevel.getNetwork().getRef();
    int stateArraySize = network.get().getStateManager().getStateArraySize();
    terminals = new ArrayList<>(stateArraySize);
    v = new TFloatArrayList(stateArraySize);
    angle = new TFloatArrayList(stateArraySize);
    connectedComponentNumber = new TIntArrayList(stateArraySize);
    synchronousComponentNumber = new TIntArrayList(stateArraySize);
    for (int i = 0; i < stateArraySize; i++) {
        terminals.add(new ArrayList<>());
        v.add(Float.NaN);
        angle.add(Float.NaN);
        connectedComponentNumber.add(-1);
        synchronousComponentNumber.add(-1);
    }
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:18,代码来源:ConfiguredBusImpl.java

示例6: Diagnostic

import gnu.trove.list.array.TIntArrayList; //导入依赖的package包/类
public Diagnostic(DiagnosticClient client)
{
	this.client = client;
	allExtensionsSilenced = 0;
	ignoreAllWarnings = false;
	warningsAsErrors = false;
	suppressSystemWarnings = false;
	extBehavior = Ext_Ignore;
	errorOccurred = false;
	fatalErrorOcurred = false;
	numDiagArgs = 0;
       numErrors = 0;

       customDiagInfo = null;
	curDiagID = ~0;
       lastDiagLevel = Level.Ignored;

       diagMappingsStack = new LinkedList<>();
       TIntArrayList blankDiags = new TIntArrayList();
       blankDiags.fill(0, DIAG_UPPER_LIMIT/2, 0);
       diagMappingsStack.addLast(blankDiags);
       argToStringFtr = DummyArgToStringFunctor;
       fixItHints = new FixItHint[maxFixItHints];
       for (int i = 0; i != fixItHints.length; i++)
           fixItHints[i] = new FixItHint();
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:27,代码来源:Diagnostic.java

示例7: parseRangeList

import gnu.trove.list.array.TIntArrayList; //导入依赖的package包/类
/**
 * RangeList ::= RangePiece (',' RangePiece)*
 * @param ranges
 */
private void parseRangeList(TIntArrayList ranges)
{
    if (parseRangePiece(ranges))
    {
        ranges.clear();
        return;
    }
    while (lexer.getCode() == TGLexer.TokKind.comma)
    {
        lexer.lex();

        if (parseRangePiece(ranges))
        {
            ranges.clear();
            return;
        }
    }
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:23,代码来源:TGParser.java

示例8: 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

示例9: convertInitializerBitRange

import gnu.trove.list.array.TIntArrayList; //导入依赖的package包/类
@Override
public Init convertInitializerBitRange(TIntArrayList bits)
{
    if (!(getType() instanceof BitsRecTy))
        return null;

    BitsRecTy t = (BitsRecTy)getType();
    int numBits = t.getNumBits();

    BitsInit bi = new BitsInit(bits.size());
    for (int i = 0, e = bits.size(); i < e; i++)
    {
        if (bits.get(i) >= numBits)
            return null;

        bi.setBit(i, new VarBitInit(this, bits.get(i)));
    }
    return bi;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:20,代码来源:Init.java

示例10: CodeGenTarget

import gnu.trove.list.array.TIntArrayList; //导入依赖的package包/类
public CodeGenTarget() throws Exception
{
    pointerType = Other;
    legalValueTypes = new TIntArrayList();

    ArrayList<Record> targets = Record.records.getAllDerivedDefinition("Target");
    if (targets.isEmpty())
        throw new Exception("Error: No target defined!");
    if (targets.size() != 1)
        throw new Exception("Error: Multiple subclasses of Target defined!");

    targetRec = targets.get(0);

    // LLVM 1.0 introduced which is removed in LLVM 2.6.
    // calleeSavedRegisters = targetRec.getValueAsListOfDefs("CalleeSavedRegisters");
    // pointerType = getValueType(targetRec.getValueAsDef("PointerType"));

    readRegisters();

    // Read register classes description information from records.
    readRegisterClasses();

    // Read the instruction description information from records.
    // readInstructions();
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:26,代码来源:CodeGenTarget.java

示例11: getRegisterVTs

import gnu.trove.list.array.TIntArrayList; //导入依赖的package包/类
/**
 * Find the union of all possible SimpleValueTypes for the
 * specified physical register.
 * @param r
 * @return
 */
public TIntArrayList getRegisterVTs(Record r)
{
    TIntArrayList res = new TIntArrayList();
    for (CodeGenRegisterClass rc : registerClasses)
    {
        for (Record elt : rc.elts)
        {
            if (r.equals(elt))
            {
                TIntArrayList inVTs = rc.getValueTypes();
                res.addAll(CodeGenDAGPatterns.convertVTs(inVTs));
            }
        }
    }
    return res;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:23,代码来源:CodeGenTarget.java

示例12: getValueAsListOfInts

import gnu.trove.list.array.TIntArrayList; //导入依赖的package包/类
public TIntArrayList getValueAsListOfInts(String fieldName) throws Exception
{
    ListInit list = getValueAsListInit(fieldName);
    TIntArrayList res = new TIntArrayList();
    for (int i = 0; i < list.getSize(); i++)
    {
        IntInit ii = list.getElement(i) instanceof IntInit ?
                (IntInit)list.getElement(i) : null;
        if (ii != null)
            res.add((int) ii.getValue());
        else
            throw new Exception("Record '" + getName() + "', field '" +
                fieldName + "' does not have a list of ints initializer!");
    }
    return res;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:17,代码来源:Record.java

示例13: CCState

import gnu.trove.list.array.TIntArrayList; //导入依赖的package包/类
public CCState(backend.support.CallingConv cc,
        boolean isVarArg,
        TargetMachine tm,
        ArrayList<CCValAssign> locs)
{
    callingConv = cc;
    this.isVarArg = isVarArg;
    this.tm = tm;
    tri = tm.getRegisterInfo();
    this.locs = locs;
    stackOffset = 0;
    usedRegs = new TIntArrayList();
    for (int capacity = (tri.getNumRegs() + 31) / 32;
         capacity != 0; --capacity)
        usedRegs.add(0);
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:17,代码来源:CCState.java

示例14: setUp

import gnu.trove.list.array.TIntArrayList; //导入依赖的package包/类
/**
 * initializes the Object set of this hash table.
 *
 * @param initialCapacity an <code>int</code> value
 * @return an <code>int</code> value
 */
@Override
public int setUp(int initialCapacity) {
    order = new TIntArrayList(initialCapacity) {
        /**
         * Grow the internal array as needed to accommodate the specified number of elements.
         * The size of the array bytes on each resize unless capacity requires more than twice
         * the current capacity.
         */
        @Override
        public void ensureCapacity(int capacity) {
            if (capacity > _data.length) {
                int newCap = Math.max(_set.length, capacity);
                int[] tmp = new int[newCap];
                System.arraycopy(_data, 0, tmp, 0, _data.length);
                _data = tmp;
            }
        }
    };
    return super.setUp(initialCapacity);    //To change body of overridden methods use File | Settings | File Templates.
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:27,代码来源:TLinkedHashSet.java

示例15: constructCostVector

import gnu.trove.list.array.TIntArrayList; //导入依赖的package包/类
private PBQPVector constructCostVector(int vreg,
        TIntArrayList allowedReg,
        TObjectDoubleHashMap<Pair<Integer, Integer>> coalsceMap,
        double spillCost)
{
    PBQPVector cost = new PBQPVector(allowedReg.size()+1);
    cost.set(0, spillCost);

    for (int i = 0, e = allowedReg.size(); i < e; i++)
    {
        int preg = allowedReg.get(i);
        Pair<Integer, Integer> regPair = Pair.get(preg, vreg);
        if (coalsceMap.containsKey(regPair))
        {
            cost.set(i+1, -coalsceMap.get(regPair));
        }
    }
    return cost;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:20,代码来源:RegAllocPBQP.java


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