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

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

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

origin: MovingBlocks/Terasology

public void add(int amount) {
  modifiers.add(amount);
}
origin: MovingBlocks/Terasology

public void subtract(int amount) {
  modifiers.add(-amount);
}
origin: alibaba/mdrill

public void add( int[] vals ) {
  synchronized( mutex ) { list.add( vals ); }
}
public void add( int[] vals, int offset, int length ) {
origin: alibaba/mdrill

public void add( int[] vals, int offset, int length ) {
  synchronized( mutex ) { list.add( vals, offset, length ); }
}
origin: CalebFenton/simplify

void push(String methodDescriptor, int address) {
  methodStack.add(methodDescriptor);
  addressStack.add(address);
}
origin: MovingBlocks/Terasology

public MeshBuilder addIndices(int... indices) {
  meshData.getIndices().add(indices);
  return this;
}
origin: MovingBlocks/Terasology

public MeshBuilder addIndex(int index) {
  meshData.getIndices().add(index);
  return this;
}
origin: MovingBlocks/Terasology

@Override
public TIntList getAsIntegerArray() {
  TIntList result = new TIntArrayList(size());
  for (JsonElement element : array) {
    result.add(element.getAsInt());
  }
  return result;
}
origin: opentripplanner/OpenTripPlanner

/**
 * Add a variable number of int arguments or an array of ints to the bag for a given stopcluster.
 * Optionally sort all the entries after a bulk add.
 */
public void add(StopCluster stopCluster, boolean sort, int... time) {
  TIntList times = timesForCluster.get(stopCluster);
  if (times == null) {
    times = new TIntArrayList();
    timesForCluster.put(stopCluster, times);
  }
  times.add(time);
  if (sort) {
    times.sort();
  }
}
origin: CalebFenton/simplify

private int[] buildParameterRegisters(List<String> parameterTypes, int[] registers) {
  TIntList parameterRegisters = new TIntLinkedList(parameterTypes.size());
  int index = 0;
  for (String parameterType : parameterTypes) {
    parameterRegisters.add(registers[index]);
    index += Utils.getRegisterSize(parameterType);
  }
  return parameterRegisters.toArray();
}
origin: alibaba/mdrill

/**
 * Inserts a value into the set.
 *
 * @param obj an <code>Object</code> value
 * @return true if the set was modified by the add operation
 */
@Override
public boolean add(E obj) {
  int index = insertKey(obj);
  if (index < 0) {
    return false;       // already present in set, nothing to add
  }
  if (!order.add(index))
    throw new IllegalStateException("Order not changed after insert");
  postInsertHook(consumeFreeSlot);
  return true;            // yes, we added something
}
origin: CalebFenton/simplify

public int[] getConnectedTerminatingAddresses() {
  TIntList addresses = new TIntLinkedList();
  for (int address : terminatingAddresses) {
    if (wasAddressReached(address)) {
      addresses.add(address);
    }
  }
  return addresses.toArray();
}
origin: MovingBlocks/Terasology

public void dispose(int buffer) {
  if (buffer != 0) {
    pool.add(buffer);
    IntBuffer dataBuffer = BufferUtils.createIntBuffer(1);
    dataBuffer.put(0);
    dataBuffer.flip();
    VertexBufferObjectUtil.bufferVboData(buffer, dataBuffer, GL15.GL_STATIC_DRAW);
    dataBuffer.flip();
    if (traceBufferUsage) {
      usageTracker.remove(buffer);
    }
  }
}
origin: MovingBlocks/Terasology

private TShortObjectMap<TIntList> createBatchBlockEventMappings(Chunk chunk) {
  TShortObjectMap<TIntList> batchBlockMap = new TShortObjectHashMap<>();
  blockManager.listRegisteredBlocks().stream().filter(Block::isLifecycleEventsRequired).forEach(block ->
      batchBlockMap.put(block.getId(), new TIntArrayList()));
  ChunkBlockIterator i = chunk.getBlockIterator();
  while (i.next()) {
    if (i.getBlock().isLifecycleEventsRequired()) {
      TIntList positionList = batchBlockMap.get(i.getBlock().getId());
      positionList.add(i.getBlockPos().x);
      positionList.add(i.getBlockPos().y);
      positionList.add(i.getBlockPos().z);
    }
  }
  return batchBlockMap;
}
origin: MovingBlocks/Terasology

public int get(String forUseBy) {
  if (pool.isEmpty()) {
    IntBuffer buffer = BufferUtils.createIntBuffer(BUFFER_FETCH_SIZE);
    GL15.glGenBuffers(buffer);
    for (int i = 0; i < BUFFER_FETCH_SIZE; ++i) {
      pool.add(buffer.get(i));
    }
    totalPoolSize += BUFFER_FETCH_SIZE;
  }
  int result = pool.removeAt(pool.size() - 1);
  if (traceBufferUsage) {
    usageTracker.put(result, forUseBy);
  }
  return result;
}
origin: MovingBlocks/Terasology

@Override
public TIntList getAsIntegerArray() {
  if (data.getIntegerCount() > 0) {
    TIntList result = new TIntArrayList(data.getIntegerCount());
    for (int i = 0; i < data.getIntegerCount(); ++i) {
      result.add(data.getInteger(i));
    }
    return result;
  } else {
    TIntList result = new TIntArrayList(data.getLongCount());
    for (int i = 0; i < data.getLongCount(); ++i) {
      result.add(Ints.saturatedCast(data.getLong(i)));
    }
    return result;
  }
}
origin: CalebFenton/simplify

private static int[] buildTerminatingAddresses(List<BuilderInstruction> instructions) {
  TIntList addresses = new TIntLinkedList();
  for (BuilderInstruction instruction : instructions) {
    int address = instruction.getLocation().getCodeAddress();
    Opcode op = instruction.getOpcode();
    switch (op) {
      case RETURN_VOID:
      case RETURN:
      case RETURN_WIDE:
      case RETURN_OBJECT:
      case THROW:
        break;
      default:
        continue;
    }
    addresses.add(address);
  }
  return addresses.toArray();
}
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;
}
origin: alibaba/mdrill

/** {@inheritDoc} */
public TIntList grep(TIntProcedure condition) {
  TIntList ret = new TIntLinkedList();
  for (TIntLink l = head; got(l); l = l.getNext()) {
    if (condition.execute(l.getValue()))
      ret.add(l.getValue());
  }
  return ret;
}
origin: alibaba/mdrill

/** {@inheritDoc} */
public TIntList inverseGrep(TIntProcedure condition) {
  TIntList ret = new TIntLinkedList();
  for (TIntLink l = head; got(l); l = l.getNext()) {
    if (!condition.execute(l.getValue()))
      ret.add(l.getValue());
  }
  return ret;
}
gnu.trove.listTIntListadd

Javadoc

Adds val to the end of the list, growing as needed.

Popular methods of TIntList

  • toArray
    Copies a slice of the list into a native array.
  • get
    Returns the value at the specified offset.
  • 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

  • Creating JSON documents from java classes using gson
  • getSystemService (Context)
  • getApplicationContext (Context)
  • setContentView (Activity)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Top plugins for WebStorm
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