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(long key) {
102 return get(key, null);
106 * Gets the Object mapped from the specified key, or the specified Object
110 public E get(long 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(long key) {
124 int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
137 public void remove(long key) {
138 delete(key);
180 * Adds a mapping from the specified key to the specified value,
181 * replacing the previous mapping from the specified key if there
184 public void put(long key, E value) {
185 int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
193 mKeys[i] = key;
202 i = ~ContainerHelpers.binarySearch(mKeys, mSize, key);
225 mKeys[i] = key;
232 * Returns the number of key-value mappings that this LongSparseArray
245 * the key from the <code>index</code>th key-value mapping that this
250 * smallest key and <code>keyAt(size()-1)</code> will return the largest
251 * key.</p>
263 * the value from the <code>index</code>th key-value mapping that this
269 * smallest key and <code>valueAt(size()-1)</code> will return the value
270 * associated with the largest key.</p>
283 * value for the <code>index</code>th key-value mapping that this
296 * specified key, or a negative number if the specified
297 * key is not mapped.
299 public int indexOfKey(long key) {
304 return ContainerHelpers.binarySearch(mKeys, mSize, key);
309 * specified key, or a negative number if no keys map to the
311 * Beware that this is a linear search, unlike lookups by key,
328 * Removes all key-value mappings from this LongSparseArray.
343 * Puts a key/value pair into the array, optimizing for the case where
344 * the key is greater than all existing keys in the array.
346 public void append(long key, E value) {
347 if (mSize != 0 && key <= mKeys[mSize - 1]) {
348 put(key, value);
371 mKeys[pos] = key;
395 long key = keyAt(i);
396 buffer.append(key);