本文整理汇总了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;
}
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
示例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;
}
}
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
示例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.
}
示例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;
}