Lines Matching defs:key

38  * as deleted.  The entry can then be re-used for the same key, or compacted later in
98 * Gets the Object mapped from the specified key, or <code>null</code>
101 public E get(int key) {
102 return get(key, null);
106 * Gets the Object mapped from the specified key, or the specified Object
110 public E get(int key, E valueIfKeyNotFound) {
111 int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
121 * Removes the mapping from the specified key, if there was any.
123 public void delete(int key) {
124 int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
137 public void remove(int key) {
138 delete(key);
193 * Adds a mapping from the specified key to the specified value,
194 * replacing the previous mapping from the specified key if there
197 public void put(int key, E value) {
198 int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
206 mKeys[i] = key;
215 i = ~ContainerHelpers.binarySearch(mKeys, mSize, key);
238 mKeys[i] = key;
245 * Returns the number of key-value mappings that this SparseArray
258 * the key from the <code>index</code>th key-value mapping that this
263 * smallest key and <code>keyAt(size()-1)</code> will return the largest
264 * key.</p>
276 * the value from the <code>index</code>th key-value mapping that this
282 * smallest key and <code>valueAt(size()-1)</code> will return the value
283 * associated with the largest key.</p>
296 * value for the <code>index</code>th key-value mapping that this
309 * specified key, or a negative number if the specified
310 * key is not mapped.
312 public int indexOfKey(int key) {
317 return ContainerHelpers.binarySearch(mKeys, mSize, key);
322 * specified key, or a negative number if no keys map to the
324 * <p>Beware that this is a linear search, unlike lookups by key,
343 * Removes all key-value mappings from this SparseArray.
358 * Puts a key/value pair into the array, optimizing for the case where
359 * the key is greater than all existing keys in the array.
361 public void append(int key, E value) {
362 if (mSize != 0 && key <= mKeys[mSize - 1]) {
363 put(key, value);
386 mKeys[pos] = key;
410 int key = keyAt(i);
411 buffer.append(key);