Tabnine Logo
IntSet.addResize
Code IndexAdd Tabnine to your IDE (free)

How to use
addResize
method
in
com.badlogic.gdx.utils.IntSet

Best Java code snippets using com.badlogic.gdx.utils.IntSet.addResize (Showing top 6 results out of 315)

origin: libgdx/libgdx

private void addStash (int key) {
  if (stashSize == stashCapacity) {
    // Too many pushes occurred and the stash is full, increase the table size.
    resize(capacity << 1);
    addResize(key);
    return;
  }
  // Store key in the stash.
  int index = capacity + stashSize;
  keyTable[index] = key;
  stashSize++;
  size++;
}
origin: libgdx/libgdx

private void addStash (int key) {
  if (stashSize == stashCapacity) {
    // Too many pushes occurred and the stash is full, increase the table size.
    resize(capacity << 1);
    addResize(key);
    return;
  }
  // Store key in the stash.
  int index = capacity + stashSize;
  keyTable[index] = key;
  stashSize++;
  size++;
}
origin: libgdx/libgdx

private void resize (int newSize) {
  int oldEndIndex = capacity + stashSize;
  capacity = newSize;
  threshold = (int)(newSize * loadFactor);
  mask = newSize - 1;
  hashShift = 31 - Integer.numberOfTrailingZeros(newSize);
  stashCapacity = Math.max(3, (int)Math.ceil(Math.log(newSize)) * 2);
  pushIterations = Math.max(Math.min(newSize, 8), (int)Math.sqrt(newSize) / 8);
  int[] oldKeyTable = keyTable;
  keyTable = new int[newSize + stashCapacity];
  int oldSize = size;
  size = hasZeroValue ? 1 : 0;
  stashSize = 0;
  if (oldSize > 0) {
    for (int i = 0; i < oldEndIndex; i++) {
      int key = oldKeyTable[i];
      if (key != EMPTY) addResize(key);
    }
  }
}
origin: libgdx/libgdx

private void resize (int newSize) {
  int oldEndIndex = capacity + stashSize;
  capacity = newSize;
  threshold = (int)(newSize * loadFactor);
  mask = newSize - 1;
  hashShift = 31 - Integer.numberOfTrailingZeros(newSize);
  stashCapacity = Math.max(3, (int)Math.ceil(Math.log(newSize)) * 2);
  pushIterations = Math.max(Math.min(newSize, 8), (int)Math.sqrt(newSize) / 8);
  int[] oldKeyTable = keyTable;
  keyTable = new int[newSize + stashCapacity];
  int oldSize = size;
  size = hasZeroValue ? 1 : 0;
  stashSize = 0;
  if (oldSize > 0) {
    for (int i = 0; i < oldEndIndex; i++) {
      int key = oldKeyTable[i];
      if (key != EMPTY) addResize(key);
    }
  }
}
origin: com.badlogicgames.gdx/gdx

private void addStash (int key) {
  if (stashSize == stashCapacity) {
    // Too many pushes occurred and the stash is full, increase the table size.
    resize(capacity << 1);
    addResize(key);
    return;
  }
  // Store key in the stash.
  int index = capacity + stashSize;
  keyTable[index] = key;
  stashSize++;
  size++;
}
origin: com.badlogicgames.gdx/gdx

private void resize (int newSize) {
  int oldEndIndex = capacity + stashSize;
  capacity = newSize;
  threshold = (int)(newSize * loadFactor);
  mask = newSize - 1;
  hashShift = 31 - Integer.numberOfTrailingZeros(newSize);
  stashCapacity = Math.max(3, (int)Math.ceil(Math.log(newSize)) * 2);
  pushIterations = Math.max(Math.min(newSize, 8), (int)Math.sqrt(newSize) / 8);
  int[] oldKeyTable = keyTable;
  keyTable = new int[newSize + stashCapacity];
  int oldSize = size;
  size = hasZeroValue ? 1 : 0;
  stashSize = 0;
  if (oldSize > 0) {
    for (int i = 0; i < oldEndIndex; i++) {
      int key = oldKeyTable[i];
      if (key != EMPTY) addResize(key);
    }
  }
}
com.badlogic.gdx.utilsIntSetaddResize

Javadoc

Skips checks for existing keys.

Popular methods of IntSet

  • add
    Returns true if the key was not already in the set.
  • contains
  • iterator
    Returns an iterator for the keys in the set. Remove is supported. Note that the same iterator instan
  • remove
    Returns true if the key was removed.
  • <init>
    Creates a new set identical to the specified set.
  • addAll
  • addStash
  • clear
    Clears the set and reduces the size of the backing arrays to be the specified capacity if they are l
  • containsKeyStash
  • ensureCapacity
    Increases the size of the backing array to accommodate the specified number of additional items. Use
  • hash2
  • hash3
  • hash2,
  • hash3,
  • push,
  • removeStash,
  • removeStashIndex,
  • resize

Popular in Java

  • Reactive rest calls using spring rest template
  • setScale (BigDecimal)
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Notification (javax.management)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top Vim 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