Example usage for Java android.util LongSparseArray fields, constructors, methods, implement or subclass
The text is from its open source code.
LongSparseArray() Creates a new LongSparseArray containing no mappings. | |
LongSparseArray(int initialCapacity) Creates a new LongSparseArray containing no mappings that will not require any additional memory allocation to store the specified number of mappings. |
void | append(long key, E value) Puts a key/value pair into the array, optimizing for the case where the key is greater than all existing keys in the array. |
E | get(long key) Gets the Object mapped from the specified key, or null if no such mapping has been made. |
E | get(long key, E valueIfKeyNotFound) Gets the Object mapped from the specified key, or the specified Object if no such mapping has been made. |
long | keyAt(int index) Given an index in the range 0...size()-1 , returns the key from the index th key-value mapping that this LongSparseArray stores. |
void | put(long key, E value) Adds a mapping from the specified key to the specified value, replacing the previous mapping from the specified key if there was one. |
void | remove(long key) Alias for #delete(long) . |
void | setValueAt(int index, E value) Given an index in the range 0...size()-1 , sets a new value for the index th key-value mapping that this LongSparseArray stores. |
int | size() Returns the number of key-value mappings that this LongSparseArray currently stores. |
E | valueAt(int index) Given an index in the range 0...size()-1 , returns the value from the index th key-value mapping that this LongSparseArray stores. |