Lines Matching defs:key

72      * Gets the Object mapped from the specified key, or <code>null</code>
75 public E get(int key) {
76 return get(key, null);
80 * Gets the Object mapped from the specified key, or the specified Object
84 public E get(int key, E valueIfKeyNotFound) {
85 int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
95 * Removes the mapping from the specified key, if there was any.
97 public void delete(int key) {
98 int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
111 public void remove(int key) {
112 delete(key);
167 * Adds a mapping from the specified key to the specified value,
168 * replacing the previous mapping from the specified key if there
171 public void put(int key, E value) {
172 int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
180 mKeys[i] = key;
189 i = ~ ContainerHelpers.binarySearch(mKeys, mSize, key);
212 mKeys[i] = key;
219 * Returns the number of key-value mappings that this SparseArray
232 * the key from the <code>index</code>th key-value mapping that this
245 * the value from the <code>index</code>th key-value mapping that this
259 * value for the <code>index</code>th key-value mapping that this
272 * specified key, or a negative number if the specified
273 * key is not mapped.
275 public int indexOfKey(int key) {
280 return ContainerHelpers.binarySearch(mKeys, mSize, key);
285 * specified key, or a negative number if no keys map to the
287 * <p>Beware that this is a linear search, unlike lookups by key,
306 * Removes all key-value mappings from this SparseArray.
321 * Puts a key/value pair into the array, optimizing for the case where
322 * the key is greater than all existing keys in the array.
324 public void append(int key, E value) {
325 if (mSize != 0 && key <= mKeys[mSize - 1]) {
326 put(key, value);
349 mKeys[pos] = key;
373 int key = keyAt(i);
374 buffer.append(key);