Tabnine Logo
TIntList.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
method
in
gnu.trove.list.TIntList

Best Java code snippets using gnu.trove.list.TIntList.get (Showing top 20 results out of 315)

origin: alibaba/mdrill

public int get( int index ) {
  synchronized( mutex ) { return list.get( index ); }
}
public int set( int index, int element) {
origin: alibaba/mdrill

@Override
public Integer get( int index ) {
  int value = list.get( index );
  if ( value == list.getNoEntryValue() ) return null;
  else return Integer.valueOf( value );
}
origin: alibaba/mdrill

public int get( int index )         { return list.get( index ); }
public int indexOf( int o )         { return list.indexOf( o ); }
origin: MovingBlocks/Terasology

private void iterate() {
  while (i < positionList.size() - 2) {
    nextResult.x = positionList.get(i++);
    nextResult.y = positionList.get(i++);
    nextResult.z = positionList.get(i++);
    if (!registry.hasPermanentBlockEntity(nextResult)) {
      return;
    }
  }
  nextResult = null;
}
origin: MovingBlocks/Terasology

  @Override
  public Vector3i deserialize(PersistedData data, DeserializationContext context) {
    if (data.isArray()) {
      PersistedDataArray dataArray = data.getAsArray();
      if (dataArray.isNumberArray() && dataArray.size() > 2) {
        TIntList ints = dataArray.getAsIntegerArray();
        return new Vector3i(ints.get(0), ints.get(1), ints.get(2));
      }
    }
    return null;
  }
}
origin: MovingBlocks/Terasology

  @Override
  public Color deserialize(PersistedData data, DeserializationContext context) {
    if (data.isArray()) {
      PersistedDataArray dataArray = data.getAsArray();
      if (dataArray.isNumberArray() && dataArray.size() > 3) {
        TIntList vals = dataArray.getAsIntegerArray();
        return new Color(vals.get(0), vals.get(1), vals.get(2), vals.get(3));
      }
    }
    if (data.isString()) {
      String value = data.getAsString();
      return new Color((int) Long.parseLong(value, 16));
    }
    throw new DeserializationException("Expecting integer array or hex-string, but found: " + String.valueOf(data));
  }
}
origin: MovingBlocks/Terasology

for (int i = 0; i < uvs.size(); i++) {
  sb.append("\tvert ").append(i).append(" (").append(uvs.get(i).x).append(" ").append(uvs.get(i).y).append(") ");
  sb.append(vertexStartWeights.get(i)).append(" ").append(vertexWeightCounts.get(i)).append("\n");
  int i1 = indices.get(i * 3);
  int i2 = indices.get(i * 3 + 1);
  int i3 = indices.get(i * 3 + 2);
  sb.append("\ttri ").append(i).append(" ").append(i1).append(" ").append(i2).append(" ").append(i3).append("\n");
origin: MovingBlocks/Terasology

/**
 * Draws the widgets contained in this layout's widget list,
 * according to the widths calculated in {@link #calcWidths(Canvas)}.
 * This is called every frame.
 *
 * @param canvas The {@link Canvas} on which this {@code RowLayout} is drawn
 */
@Override
public void onDraw(Canvas canvas) {
  TIntList widths = calcWidths(canvas);
  if (!contents.isEmpty()) {
    int xOffset = 0;
    for (int i = 0; i < contents.size(); ++i) {
      int itemWidth = widths.get(i);
      Rect2i region = Rect2i.createFromMinAndSize(xOffset, 0, itemWidth, canvas.size().y);
      canvas.drawWidget(contents.get(i), region);
      xOffset += itemWidth;
      xOffset += horizontalSpacing;
    }
  }
}
origin: MovingBlocks/Terasology

  @Override
  public Vector2i deserialize(PersistedData data, DeserializationContext context) {
    if (data.isArray()) {
      PersistedDataArray dataArray = data.getAsArray();
      if (dataArray.isNumberArray() && dataArray.size() > 1) {
        TIntList ints = dataArray.getAsIntegerArray();
        return new Vector2i(ints.get(0), ints.get(1));
      }
    }
    return null;
  }
}
origin: MovingBlocks/Terasology

Vector3f norm = new Vector3f();
for (int i = 0; i < indices.size() / 3; ++i) {
  Vector3f baseVert = vertices.get(indices.get(i * 3));
  v1.sub(vertices.get(indices.get(i * 3 + 1)), baseVert);
  v2.sub(vertices.get(indices.get(i * 3 + 2)), baseVert);
  v1.normalize();
  v2.normalize();
  norm.cross(v1, v2);
  normals.get(indices.get(i * 3)).add(norm);
  normals.get(indices.get(i * 3 + 1)).add(norm);
  normals.get(indices.get(i * 3 + 2)).add(norm);
for (int vertIndex = 0; vertIndex < vertices.size(); ++vertIndex) {
  Vector3f normal = normals.get(vertIndex);
  for (int weightIndex = 0; weightIndex < vertexWeightCounts.get(vertIndex); ++weightIndex) {
    BoneWeight weight = weights.get(weightIndex + vertexStartWeights.get(vertIndex));
    inverseRot.inverse(bones.get(weight.getBoneIndex()).getObjectRotation());
    inverseRot.rotate(normal, norm);
origin: MovingBlocks/Terasology

@Override
public boolean isValidAnimationFor(SkeletalMesh mesh) {
  for (int i = 0; i < data.getBoneNames().size(); ++i) {
    Bone bone = mesh.getBone(data.getBoneNames().get(i));
    boolean hasParent = data.getBoneParent().get(i) != MeshAnimationData.NO_PARENT;
    if (hasParent && (bone.getParent() == null || !bone.getParent().getName().equals(data.getBoneNames().get(data.getBoneParent().get(i))))) {
      return false;
    } else if (!hasParent && bone.getParent() != null) {
      return false;
    }
  }
  return true;
}
origin: MovingBlocks/Terasology

/**
 * Retrieves the preferred content size of this {@code RowLayout}.
 * This is the minimum size this layout will take, given no space restrictions.
 *
 * @param canvas The {@code Canvas} on which this {@code RowLayout} is drawn
 * @param areaHint A {@link Vector2i} representing the space available for widgets to be drawn in this layout
 * @return A {@link Vector2i} representing the preferred content size of this {@code RowLayout}
 */
@Override
public Vector2i getPreferredContentSize(Canvas canvas, Vector2i areaHint) {
  TIntList widths = calcWidths(canvas);
  Vector2i result = new Vector2i(areaHint.x, 0);
  for (int i = 0; i < contents.size(); ++i) {
    Vector2i widgetSize = canvas.calculateRestrictedSize(contents.get(i), new Vector2i(TeraMath.floorToInt(widths.get(i)), areaHint.y));
    result.y = Math.max(result.y, widgetSize.y);
  }
  return result;
}
origin: MovingBlocks/Terasology

public List<Vector3f> getVertexNormals(List<Vector3f> bonePositions, List<Quat4f> boneRotations) {
  List<Vector3f> results = Lists.newArrayListWithCapacity(getVertexCount());
  for (int i = 0; i < vertexStartWeights.size(); ++i) {
    Vector3f vertexNorm = new Vector3f();
    for (int weightIndexOffset = 0; weightIndexOffset < vertexWeightCounts.get(i); ++weightIndexOffset) {
      int weightIndex = vertexStartWeights.get(i) + weightIndexOffset;
      BoneWeight weight = weights.get(weightIndex);
      Vector3f current = boneRotations.get(weight.getBoneIndex()).rotate(weight.getNormal(), new Vector3f());
      current.scale(weight.getBias());
      vertexNorm.add(current);
    }
    results.add(vertexNorm);
  }
  return results;
}
origin: MovingBlocks/Terasology

public List<Vector3f> getVertexPositions(List<Vector3f> bonePositions, List<Quat4f> boneRotations) {
  List<Vector3f> results = Lists.newArrayListWithCapacity(getVertexCount());
  for (int i = 0; i < vertexStartWeights.size(); ++i) {
    Vector3f vertexPos = new Vector3f();
    for (int weightIndexOffset = 0; weightIndexOffset < vertexWeightCounts.get(i); ++weightIndexOffset) {
      int weightIndex = vertexStartWeights.get(i) + weightIndexOffset;
      BoneWeight weight = weights.get(weightIndex);
      Vector3f current = boneRotations.get(weight.getBoneIndex()).rotate(weight.getPosition(), new Vector3f());
      current.add(bonePositions.get(weight.getBoneIndex()));
      current.scale(weight.getBias());
      vertexPos.add(current);
    }
    results.add(vertexPos);
  }
  return results;
}
origin: MovingBlocks/Terasology

@Override
public EntityRef deserialize(PersistedData data, DeserializationContext context) {
  if (data.isArray()) {
    PersistedDataArray array = data.getAsArray();
    if (array.isNumberArray() && array.size() == 3) {
      TIntList items = data.getAsArray().getAsIntegerArray();
      Vector3i pos = new Vector3i(items.get(0), items.get(1), items.get(2));
      return blockEntityRegistry.getBlockEntityAt(pos);
    }
  }
  if (data.isNumber()) {
    return networkSystem.getEntity(data.getAsInteger());
  }
  return EntityRef.NULL;
}
origin: MovingBlocks/Terasology

private void createVertexBuffer(List<TFloatIterator> parts, TIntList partSizes, int vertexCount, int vertexSize) {
  FloatBuffer vertexBuffer = BufferUtils.createFloatBuffer(vertexSize * vertexCount);
  for (int v = 0; v < vertexCount; ++v) {
    for (int partIndex = 0; partIndex < parts.size(); ++partIndex) {
      TFloatIterator part = parts.get(partIndex);
      for (int i = 0; i < partSizes.get(partIndex); ++i) {
        vertexBuffer.put(part.next());
      }
    }
  }
  vertexBuffer.flip();
  if (disposalAction.vboVertexBuffer == 0) {
    disposalAction.vboVertexBuffer = disposalAction.bufferPool.get(getUrn().toString());
  }
  VertexBufferObjectUtil.bufferVboData(disposalAction.vboVertexBuffer, vertexBuffer, GL15.GL_STATIC_DRAW);
  vertexBuffer.flip();
}
origin: opentripplanner/OpenTripPlanner

          .get(randomNumbers[nextRandom++ % randomNumbers.length] % count);
case PERCENTILE:
  timeList.sort();
  mins[stop] = timeList.get(timeList.size() / 40);
  maxs[stop] = timeList.get(39 * timeList.size() / 40);
  break;
case NONE:
origin: MovingBlocks/Terasology

elements.finalVertices.put(Float.floatToIntBits(elements.flags.get(cFlags)));
origin: MovingBlocks/Terasology

int remainingWidthPerElement = (width - totalWidthUsed) / unprocessedWidgets;
for (int i = 0; i < results.size(); ++i) {
  if (results.get(i) == 0) {
    RowLayoutHint hint = hints.get(contents.get(i));
    if (hint != null) {
int remainingWidthPerElement = (width - totalWidthUsed) / unprocessedWidgets;
for (int i = 0; i < results.size(); ++i) {
  if (results.get(i) == 0) {
    results.set(i, remainingWidthPerElement);
origin: MovingBlocks/Terasology

public SkeletalMeshDataBuilder addMesh(Bone bone, MeshData data) {
  TFloatList meshVertices = data.getVertices();
  TIntList meshIndices = data.getIndices();
  TFloatList texCoord0 = data.getTexCoord0();
  int weightsStart = weights.size();
  addBone(bone);
  for (int i = 0; i < meshVertices.size() / 3; i++) {
    float x = meshVertices.get(i * 3);
    float y = meshVertices.get(i * 3 + 1);
    float z = meshVertices.get(i * 3 + 2);
    Vector3f pos = new Vector3f(x, y, z);
    BoneWeight weight = new BoneWeight(pos, 1, bone.getIndex());
    // TODO Meshes may contain normal vectors and we may copy them to the weight here
    //   - but they are recalculated later on in either case. needs some rework
    addWeight(weight);
    vertexStartWeights.add(weightsStart + i);
    vertexWeightCounts.add(1);
    uvs.add(new Vector2f(texCoord0.get(i * 2), texCoord0.get(i * 2 + 1)));
  }
  for (int i = 0; i < meshIndices.size(); i++) {
    indices.add(meshIndices.get(i) + weightsStart);
  }
  return this;
}
gnu.trove.listTIntListget

Javadoc

Returns the value at the specified offset.

Popular methods of TIntList

  • add
    Adds a subset of the values in the array vals to the end of the list, in order.
  • toArray
    Copies a slice of the list into a native array.
  • size
    Returns the number of values in the list.
  • sort
    Sort a slice of the list (ascending) using the Sun quicksort implementation.
  • iterator
  • set
    Replace the values in the list starting at offset withlength values from the values array, starting
  • clear
    Flushes the internal state of the list, resetting the capacity to the default.
  • remove
    Removes length values from the list, starting atoffset
  • reverse
    Reverse the order of the elements in the range of the list.
  • max
    Finds the maximum value in the list.
  • min
    Finds the minimum value in the list.
  • isEmpty
    Tests whether this list contains any values.
  • min,
  • isEmpty,
  • fill,
  • removeAt,
  • replace,
  • shuffle,
  • subList,
  • sum,
  • binarySearch

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • startActivity (Activity)
  • addToBackStack (FragmentTransaction)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now