/** * Gets the int mapped from the specified key, or the specified value * if no such mapping has been made. */ public int get(int key, int valueIfKeyNotFound) { int i = binarySearch(mKeys, 0, mSize, key); if (i < 0) { return valueIfKeyNotFound; } else { return mValues[i]; } }
/** * Returns the index for which {@link #keyAt} would return the * specified key, or a negative number if the specified * key is not mapped. */ public int indexOfKey(int key) { return binarySearch(mKeys, 0, mSize, key); }
/** * Gets the int mapped from the specified key, or the specified value * if no such mapping has been made. */ public int get(int key, int valueIfKeyNotFound) { int i = binarySearch(mKeys, 0, mSize, key); if (i < 0) { return valueIfKeyNotFound; } else { return mValues[i]; } }
/** * Returns the index for which {@link #keyAt} would return the * specified key, or a negative number if the specified * key is not mapped. */ public int indexOfKey(int key) { return binarySearch(mKeys, 0, mSize, key); }
/** * Gets the int mapped from the specified key, or the specified value * if no such mapping has been made. */ public int get(int key, int valueIfKeyNotFound) { int i = binarySearch(mKeys, 0, mSize, key); if (i < 0) { return valueIfKeyNotFound; } else { return mValues[i]; } }
/** * Returns the index for which {@link #keyAt} would return the * specified key, or a negative number if the specified * key is not mapped. */ public int indexOfKey(int key) { return binarySearch(mKeys, 0, mSize, key); }
/** * Gets the int mapped from the specified key, or if not present, the * closest key that is less than the specified key. */ public int getClosestSmaller(int key) { int i = binarySearch(mKeys, 0, mSize, key); if (i < 0) { i = ~i; if (i > 0) { i--; } return mValues[i]; } else { return mValues[i]; } }
/** * Gets the int mapped from the specified key, or if not present, the * closest key that is less than the specified key. */ public int getClosestSmaller(int key) { int i = binarySearch(mKeys, 0, mSize, key); if (i < 0) { i = ~i; if (i > 0) { i--; } return mValues[i]; } else { return mValues[i]; } }
/** * Gets the int mapped from the specified key, or if not present, the * closest key that is less than the specified key. */ public int getClosestSmaller(int key) { int i = binarySearch(mKeys, 0, mSize, key); if (i < 0) { i = ~i; if (i > 0) { i--; } return mValues[i]; } else { return mValues[i]; } }
/** * Removes the mapping from the specified key, if there was any. */ public void delete(int key) { int i = binarySearch(mKeys, 0, mSize, key); if (i >= 0) { removeAt(i); } }
/** * Removes the mapping from the specified key, if there was any. */ public void delete(int key) { int i = binarySearch(mKeys, 0, mSize, key); if (i >= 0) { removeAt(i); } }
/** * Removes the mapping from the specified key, if there was any. */ public void delete(int key) { int i = binarySearch(mKeys, 0, mSize, key); if (i >= 0) { removeAt(i); } }
int i = binarySearch(mKeys, 0, mSize, key);
int i = binarySearch(mKeys, 0, mSize, key);
int i = binarySearch(mKeys, 0, mSize, key);