Lines Matching refs:key

91      * Gets the long mapped from the specified key, or <code>0</code>
94 public long get(long key) {
95 return get(key, 0);
99 * Gets the long mapped from the specified key, or the specified value
102 public long get(long key, long valueIfKeyNotFound) {
103 int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
113 * Removes the mapping from the specified key, if there was any.
115 public void delete(long key) {
116 int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
133 * Adds a mapping from the specified key to the specified value,
134 * replacing the previous mapping from the specified key if there
137 public void put(long key, long value) {
138 int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
145 mKeys = GrowingArrayUtils.insert(mKeys, mSize, i, key);
152 * Returns the number of key-value mappings that this SparseIntArray
161 * the key from the <code>index</code>th key-value mapping that this
166 * smallest key and <code>keyAt(size()-1)</code> will return the largest
167 * key.</p>
175 * the value from the <code>index</code>th key-value mapping that this
181 * smallest key and <code>valueAt(size()-1)</code> will return the value
182 * associated with the largest key.</p>
190 * specified key, or a negative number if the specified
191 * key is not mapped.
193 public int indexOfKey(long key) {
194 return ContainerHelpers.binarySearch(mKeys, mSize, key);
199 * specified key, or a negative number if no keys map to the
201 * Beware that this is a linear search, unlike lookups by key,
214 * Removes all key-value mappings from this SparseIntArray.
221 * Puts a key/value pair into the array, optimizing for the case where
222 * the key is greater than all existing keys in the array.
224 public void append(long key, long value) {
225 if (mSize != 0 && key <= mKeys[mSize - 1]) {
226 put(key, value);
230 mKeys = GrowingArrayUtils.append(mKeys, mSize, key);
252 long key = keyAt(i);
253 buffer.append(key);