congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
SparseArray.gc
Code IndexAdd Tabnine to your IDE (free)

How to use
gc
method
in
com.lody.virtual.helper.collection.SparseArray

Best Java code snippets using com.lody.virtual.helper.collection.SparseArray.gc (Showing top 20 results out of 315)

origin: android-hacker/VirtualXposed

/**
 * Given an index in the range <code>0...size()-1</code>, returns
 * the key from the <code>index</code>th key-value mapping that this
 * SparseArray stores.
 */
public int keyAt(int index) {
  if (mGarbage) {
    gc();
  }
  return mKeys[index];
}
origin: android-hacker/VirtualXposed

/**
 * Returns the number of key-value mappings that this SparseArray
 * currently stores.
 */
public int size() {
  if (mGarbage) {
    gc();
  }
  return mSize;
}
origin: android-hacker/VirtualXposed

/**
 * Given an index in the range <code>0...size()-1</code>, sets a new
 * value for the <code>index</code>th key-value mapping that this
 * SparseArray stores.
 */
public void setValueAt(int index, E value) {
  if (mGarbage) {
    gc();
  }
  mValues[index] = value;
}
origin: android-hacker/VirtualXposed

/**
 * Given an index in the range <code>0...size()-1</code>, returns
 * the value from the <code>index</code>th key-value mapping that this
 * SparseArray stores.
 */
@SuppressWarnings("unchecked")
public E valueAt(int index) {
  if (mGarbage) {
    gc();
  }
  return (E) mValues[index];
}
origin: android-hacker/VirtualXposed

/**
 * Returns an index for which {@link #valueAt} would return the
 * specified key, or a negative number if no keys map to the
 * specified value.
 * <p>Beware that this is a linear search, unlike lookups by key,
 * and that multiple keys can map to the same value and this will
 * find only one of them.
 * <p>Note also that unlike most collections' {@code indexOf} methods,
 * this method compares values using {@code ==} rather than {@code equals}.
 */
public int indexOfValue(E value) {
  if (mGarbage) {
    gc();
  }
  for (int i = 0; i < mSize; i++)
    if (mValues[i] == value)
      return i;
  return -1;
}
origin: android-hacker/VirtualXposed

/**
 * Returns the index for which {@link #keyAt} would return the
 * specified key, or a negative number if the specified
 * key is not mapped.
 */
public int indexOfKey(int key) {
  if (mGarbage) {
    gc();
  }
  return  ContainerHelpers.binarySearch(mKeys, mSize, key);
}
origin: android-hacker/VirtualXposed

/**
 * Puts a key/value pair into the array, optimizing for the case where
 * the key is greater than all existing keys in the array.
 */
public void append(int key, E value) {
  if (mSize != 0 && key <= mKeys[mSize - 1]) {
    put(key, value);
    return;
  }
  if (mGarbage && mSize >= mKeys.length) {
    gc();
  }
  int pos = mSize;
  if (pos >= mKeys.length) {
    int n =  ContainerHelpers.idealIntArraySize(pos + 1);
    int[] nkeys = new int[n];
    Object[] nvalues = new Object[n];
    // Log.e("SparseArray", "grow " + mKeys.length + " to " + n);
    System.arraycopy(mKeys, 0, nkeys, 0, mKeys.length);
    System.arraycopy(mValues, 0, nvalues, 0, mValues.length);
    mKeys = nkeys;
    mValues = nvalues;
  }
  mKeys[pos] = key;
  mValues[pos] = value;
  mSize = pos + 1;
}
origin: android-hacker/VirtualXposed

gc();
origin: darkskygit/VirtualApp

/**
 * Returns the number of key-value mappings that this SparseArray
 * currently stores.
 */
public int size() {
  if (mGarbage) {
    gc();
  }
  return mSize;
}
origin: bzsome/VirtualApp-x326

/**
 * Returns the number of key-value mappings that this SparseArray
 * currently stores.
 */
public int size() {
  if (mGarbage) {
    gc();
  }
  return mSize;
}
origin: bzsome/VirtualApp-x326

/**
 * Given an index in the range <code>0...size()-1</code>, returns
 * the key from the <code>index</code>th key-value mapping that this
 * SparseArray stores.
 */
public int keyAt(int index) {
  if (mGarbage) {
    gc();
  }
  return mKeys[index];
}
origin: darkskygit/VirtualApp

/**
 * Given an index in the range <code>0...size()-1</code>, returns
 * the key from the <code>index</code>th key-value mapping that this
 * SparseArray stores.
 */
public int keyAt(int index) {
  if (mGarbage) {
    gc();
  }
  return mKeys[index];
}
origin: darkskygit/VirtualApp

/**
 * Given an index in the range <code>0...size()-1</code>, returns
 * the value from the <code>index</code>th key-value mapping that this
 * SparseArray stores.
 */
@SuppressWarnings("unchecked")
public E valueAt(int index) {
  if (mGarbage) {
    gc();
  }
  return (E) mValues[index];
}
origin: darkskygit/VirtualApp

/**
 * Given an index in the range <code>0...size()-1</code>, sets a new
 * value for the <code>index</code>th key-value mapping that this
 * SparseArray stores.
 */
public void setValueAt(int index, E value) {
  if (mGarbage) {
    gc();
  }
  mValues[index] = value;
}
origin: bzsome/VirtualApp-x326

/**
 * Given an index in the range <code>0...size()-1</code>, returns
 * the value from the <code>index</code>th key-value mapping that this
 * SparseArray stores.
 */
@SuppressWarnings("unchecked")
public E valueAt(int index) {
  if (mGarbage) {
    gc();
  }
  return (E) mValues[index];
}
origin: bzsome/VirtualApp-x326

/**
 * Given an index in the range <code>0...size()-1</code>, sets a new
 * value for the <code>index</code>th key-value mapping that this
 * SparseArray stores.
 */
public void setValueAt(int index, E value) {
  if (mGarbage) {
    gc();
  }
  mValues[index] = value;
}
origin: darkskygit/VirtualApp

/**
 * Returns an index for which {@link #valueAt} would return the
 * specified key, or a negative number if no keys map to the
 * specified value.
 * <p>Beware that this is a linear search, unlike lookups by key,
 * and that multiple keys can map to the same value and this will
 * find only one of them.
 * <p>Note also that unlike most collections' {@code indexOf} methods,
 * this method compares values using {@code ==} rather than {@code equals}.
 */
public int indexOfValue(E value) {
  if (mGarbage) {
    gc();
  }
  for (int i = 0; i < mSize; i++)
    if (mValues[i] == value)
      return i;
  return -1;
}
origin: bzsome/VirtualApp-x326

/**
 * Returns an index for which {@link #valueAt} would return the
 * specified key, or a negative number if no keys map to the
 * specified value.
 * <p>Beware that this is a linear search, unlike lookups by key,
 * and that multiple keys can map to the same value and this will
 * find only one of them.
 * <p>Note also that unlike most collections' {@code indexOf} methods,
 * this method compares values using {@code ==} rather than {@code equals}.
 */
public int indexOfValue(E value) {
  if (mGarbage) {
    gc();
  }
  for (int i = 0; i < mSize; i++)
    if (mValues[i] == value)
      return i;
  return -1;
}
origin: bzsome/VirtualApp-x326

/**
 * Returns the index for which {@link #keyAt} would return the
 * specified key, or a negative number if the specified
 * key is not mapped.
 */
public int indexOfKey(int key) {
  if (mGarbage) {
    gc();
  }
  return  ContainerHelpers.binarySearch(mKeys, mSize, key);
}
origin: darkskygit/VirtualApp

/**
 * Returns the index for which {@link #keyAt} would return the
 * specified key, or a negative number if the specified
 * key is not mapped.
 */
public int indexOfKey(int key) {
  if (mGarbage) {
    gc();
  }
  return  ContainerHelpers.binarySearch(mKeys, mSize, key);
}
com.lody.virtual.helper.collectionSparseArraygc

Popular methods of SparseArray

  • <init>
    Creates a new SparseArray containing no mappings that will not require any additional memory allocat
  • clear
    Removes all key-value mappings from this SparseArray.
  • delete
    Removes the mapping from the specified key, if there was any.
  • get
    Gets the Object mapped from the specified key, or the specified Object if no such mapping has been m
  • keyAt
    Given an index in the range 0...size()-1, returns the key from the indexth key-value mapping that th
  • put
    Adds a mapping from the specified key to the specified value, replacing the previous mapping from th
  • remove
    Alias for #delete(int).
  • removeAt
    Removes the mapping at the specified index.
  • removeReturnOld
  • size
    Returns the number of key-value mappings that this SparseArray currently stores.
  • valueAt
    Given an index in the range 0...size()-1, returns the value from the indexth key-value mapping that
  • valueAt

Popular in Java

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • Kernel (java.awt.image)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • JLabel (javax.swing)
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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