當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。