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

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

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

origin: libgdx/libgdx

/** Clears the set and reduces the size of the backing arrays to be the specified capacity if they are larger. */
public void clear (int maximumCapacity) {
  if (capacity <= maximumCapacity) {
    clear();
    return;
  }
  hasZeroValue = false;
  size = 0;
  resize(maximumCapacity);
}
origin: libgdx/libgdx

/** Increases the size of the backing array to accommodate the specified number of additional items. Useful before adding many
 * items to avoid multiple backing array resizes. */
public void ensureCapacity (int additionalCapacity) {
  if (additionalCapacity < 0) throw new IllegalArgumentException("additionalCapacity must be >= 0: " + additionalCapacity);
  int sizeNeeded = size + additionalCapacity;
  if (sizeNeeded >= threshold) resize(MathUtils.nextPowerOfTwo((int)Math.ceil(sizeNeeded / loadFactor)));
}
origin: libgdx/libgdx

/** Reduces the size of the backing arrays to be the specified capacity or less. If the capacity is already less, nothing is
 * done. If the set contains more items than the specified capacity, the next highest power of two capacity is used instead. */
public void shrink (int maximumCapacity) {
  if (maximumCapacity < 0) throw new IllegalArgumentException("maximumCapacity must be >= 0: " + maximumCapacity);
  if (size > maximumCapacity) maximumCapacity = size;
  if (capacity <= maximumCapacity) return;
  maximumCapacity = MathUtils.nextPowerOfTwo(maximumCapacity);
  resize(maximumCapacity);
}
origin: libgdx/libgdx

/** Clears the set and reduces the size of the backing arrays to be the specified capacity if they are larger. */
public void clear (int maximumCapacity) {
  if (capacity <= maximumCapacity) {
    clear();
    return;
  }
  hasZeroValue = false;
  size = 0;
  resize(maximumCapacity);
}
origin: libgdx/libgdx

/** Increases the size of the backing array to accommodate the specified number of additional items. Useful before adding many
 * items to avoid multiple backing array resizes. */
public void ensureCapacity (int additionalCapacity) {
  if (additionalCapacity < 0) throw new IllegalArgumentException("additionalCapacity must be >= 0: " + additionalCapacity);
  int sizeNeeded = size + additionalCapacity;
  if (sizeNeeded >= threshold) resize(MathUtils.nextPowerOfTwo((int)Math.ceil(sizeNeeded / loadFactor)));
}
origin: libgdx/libgdx

/** Reduces the size of the backing arrays to be the specified capacity or less. If the capacity is already less, nothing is
 * done. If the set contains more items than the specified capacity, the next highest power of two capacity is used instead. */
public void shrink (int maximumCapacity) {
  if (maximumCapacity < 0) throw new IllegalArgumentException("maximumCapacity must be >= 0: " + maximumCapacity);
  if (size > maximumCapacity) maximumCapacity = size;
  if (capacity <= maximumCapacity) return;
  maximumCapacity = MathUtils.nextPowerOfTwo(maximumCapacity);
  resize(maximumCapacity);
}
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

/** Skips checks for existing keys. */
private void addResize (int key) {
  if (key == 0) {
    hasZeroValue = true;
    return;
  }
  // Check for empty buckets.
  int index1 = key & mask;
  int key1 = keyTable[index1];
  if (key1 == EMPTY) {
    keyTable[index1] = key;
    if (size++ >= threshold) resize(capacity << 1);
    return;
  }
  int index2 = hash2(key);
  int key2 = keyTable[index2];
  if (key2 == EMPTY) {
    keyTable[index2] = key;
    if (size++ >= threshold) resize(capacity << 1);
    return;
  }
  int index3 = hash3(key);
  int key3 = keyTable[index3];
  if (key3 == EMPTY) {
    keyTable[index3] = key;
    if (size++ >= threshold) resize(capacity << 1);
    return;
  }
  push(key, index1, key1, index2, key2, index3, key3);
}
origin: libgdx/libgdx

/** Skips checks for existing keys. */
private void addResize (int key) {
  if (key == 0) {
    hasZeroValue = true;
    return;
  }
  // Check for empty buckets.
  int index1 = key & mask;
  int key1 = keyTable[index1];
  if (key1 == EMPTY) {
    keyTable[index1] = key;
    if (size++ >= threshold) resize(capacity << 1);
    return;
  }
  int index2 = hash2(key);
  int key2 = keyTable[index2];
  if (key2 == EMPTY) {
    keyTable[index2] = key;
    if (size++ >= threshold) resize(capacity << 1);
    return;
  }
  int index3 = hash3(key);
  int key3 = keyTable[index3];
  if (key3 == EMPTY) {
    keyTable[index3] = key;
    if (size++ >= threshold) resize(capacity << 1);
    return;
  }
  push(key, index1, key1, index2, key2, index3, key3);
}
origin: libgdx/libgdx

if (size++ >= threshold) resize(capacity << 1);
return true;
if (size++ >= threshold) resize(capacity << 1);
return true;
if (size++ >= threshold) resize(capacity << 1);
return true;
origin: libgdx/libgdx

if (size++ >= threshold) resize(capacity << 1);
return true;
if (size++ >= threshold) resize(capacity << 1);
return true;
if (size++ >= threshold) resize(capacity << 1);
return true;
origin: libgdx/libgdx

if (key1 == EMPTY) {
  keyTable[index1] = evictedKey;
  if (size++ >= threshold) resize(capacity << 1);
  return;
if (key2 == EMPTY) {
  keyTable[index2] = evictedKey;
  if (size++ >= threshold) resize(capacity << 1);
  return;
if (key3 == EMPTY) {
  keyTable[index3] = evictedKey;
  if (size++ >= threshold) resize(capacity << 1);
  return;
origin: libgdx/libgdx

if (key1 == EMPTY) {
  keyTable[index1] = evictedKey;
  if (size++ >= threshold) resize(capacity << 1);
  return;
if (key2 == EMPTY) {
  keyTable[index2] = evictedKey;
  if (size++ >= threshold) resize(capacity << 1);
  return;
if (key3 == EMPTY) {
  keyTable[index3] = evictedKey;
  if (size++ >= threshold) resize(capacity << 1);
  return;
origin: com.badlogicgames.gdx/gdx

/** Reduces the size of the backing arrays to be the specified capacity or less. If the capacity is already less, nothing is
 * done. If the set contains more items than the specified capacity, the next highest power of two capacity is used instead. */
public void shrink (int maximumCapacity) {
  if (maximumCapacity < 0) throw new IllegalArgumentException("maximumCapacity must be >= 0: " + maximumCapacity);
  if (size > maximumCapacity) maximumCapacity = size;
  if (capacity <= maximumCapacity) return;
  maximumCapacity = MathUtils.nextPowerOfTwo(maximumCapacity);
  resize(maximumCapacity);
}
origin: com.badlogicgames.gdx/gdx

/** Increases the size of the backing array to accommodate the specified number of additional items. Useful before adding many
 * items to avoid multiple backing array resizes. */
public void ensureCapacity (int additionalCapacity) {
  if (additionalCapacity < 0) throw new IllegalArgumentException("additionalCapacity must be >= 0: " + additionalCapacity);
  int sizeNeeded = size + additionalCapacity;
  if (sizeNeeded >= threshold) resize(MathUtils.nextPowerOfTwo((int)Math.ceil(sizeNeeded / loadFactor)));
}
origin: com.badlogicgames.gdx/gdx

/** Clears the set and reduces the size of the backing arrays to be the specified capacity if they are larger. */
public void clear (int maximumCapacity) {
  if (capacity <= maximumCapacity) {
    clear();
    return;
  }
  hasZeroValue = false;
  size = 0;
  resize(maximumCapacity);
}
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

/** Skips checks for existing keys. */
private void addResize (int key) {
  if (key == 0) {
    hasZeroValue = true;
    return;
  }
  // Check for empty buckets.
  int index1 = key & mask;
  int key1 = keyTable[index1];
  if (key1 == EMPTY) {
    keyTable[index1] = key;
    if (size++ >= threshold) resize(capacity << 1);
    return;
  }
  int index2 = hash2(key);
  int key2 = keyTable[index2];
  if (key2 == EMPTY) {
    keyTable[index2] = key;
    if (size++ >= threshold) resize(capacity << 1);
    return;
  }
  int index3 = hash3(key);
  int key3 = keyTable[index3];
  if (key3 == EMPTY) {
    keyTable[index3] = key;
    if (size++ >= threshold) resize(capacity << 1);
    return;
  }
  push(key, index1, key1, index2, key2, index3, key3);
}
origin: com.badlogicgames.gdx/gdx

if (size++ >= threshold) resize(capacity << 1);
return true;
if (size++ >= threshold) resize(capacity << 1);
return true;
if (size++ >= threshold) resize(capacity << 1);
return true;
com.badlogic.gdx.utilsIntSetresize

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
  • addResize
    Skips checks for existing keys.
  • 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
  • ensureCapacity,
  • hash2,
  • hash3,
  • push,
  • removeStash,
  • removeStashIndex

Popular in Java

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • putExtra (Intent)
  • setScale (BigDecimal)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • String (java.lang)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • 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