Lines Matching refs:key

86      * Gets the boolean mapped from the specified key, or <code>false</code>
89 public boolean get(int key) {
90 return get(key, false);
94 * Gets the boolean mapped from the specified key, or the specified value
97 public boolean get(int key, boolean valueIfKeyNotFound) {
98 int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
108 * Removes the mapping from the specified key, if there was any.
110 public void delete(int key) {
111 int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
128 * Adds a mapping from the specified key to the specified value,
129 * replacing the previous mapping from the specified key if there
132 public void put(int key, boolean value) {
133 int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
140 mKeys = GrowingArrayUtils.insert(mKeys, mSize, i, key);
147 * Returns the number of key-value mappings that this SparseBooleanArray
156 * the key from the <code>index</code>th key-value mapping that this
161 * smallest key and <code>keyAt(size()-1)</code> will return the largest
162 * key.</p>
170 * the value from the <code>index</code>th key-value mapping that this
176 * smallest key and <code>valueAt(size()-1)</code> will return the value
177 * associated with the largest key.</p>
189 public void setKeyAt(int index, int key) {
190 mKeys[index] = key;
195 * specified key, or a negative number if the specified
196 * key is not mapped.
198 public int indexOfKey(int key) {
199 return ContainerHelpers.binarySearch(mKeys, mSize, key);
204 * specified key, or a negative number if no keys map to the
206 * Beware that this is a linear search, unlike lookups by key,
219 * Removes all key-value mappings from this SparseBooleanArray.
226 * Puts a key/value pair into the array, optimizing for the case where
227 * the key is greater than all existing keys in the array.
229 public void append(int key, boolean value) {
230 if (mSize != 0 && key <= mKeys[mSize - 1]) {
231 put(key, value);
235 mKeys = GrowingArrayUtils.append(mKeys, mSize, key);
292 int key = keyAt(i);
293 buffer.append(key);