/** * 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) { if (mValues[i] != DELETED) { mValues[i] = DELETED; mGarbage = true; } } }
/** * 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) { if (mValues[i] != DELETED) { mValues[i] = DELETED; mGarbage = true; } } }
/** * Gets the Object mapped from the specified key, or the specified Object * if no such mapping has been made. */ public E get(int key, E valueIfKeyNotFound) { int i = binarySearch(mKeys, 0, mSize, key); if (i < 0 || mValues[i] == DELETED) { return valueIfKeyNotFound; } else { return (E) 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) { if (mValues[i] != DELETED) { mValues[i] = DELETED; mGarbage = true; } } }
/** * Gets the Object mapped from the specified key, or the specified Object * if no such mapping has been made. */ public E get(int key, E valueIfKeyNotFound) { int i = binarySearch(mKeys, 0, mSize, key); if (i < 0 || mValues[i] == DELETED) { return valueIfKeyNotFound; } else { return (E) mValues[i]; } }
/** * Gets the Object mapped from the specified key, or the specified Object * if no such mapping has been made. */ public E get(int key, E valueIfKeyNotFound) { int i = binarySearch(mKeys, 0, mSize, key); if (i < 0 || mValues[i] == DELETED) { return valueIfKeyNotFound; } else { return (E) 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) { if (mGarbage) { gc(); } return binarySearch(mKeys, 0, mSize, key); }
/** * 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) { if (mGarbage) { gc(); } return binarySearch(mKeys, 0, mSize, key); }
/** * 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) { if (mGarbage) { gc(); } return binarySearch(mKeys, 0, mSize, key); }
int i = binarySearch(mKeys, 0, mSize, key); i = ~binarySearch(mKeys, 0, mSize, key);
int i = binarySearch(mKeys, 0, mSize, key); i = ~binarySearch(mKeys, 0, mSize, key);
int i = binarySearch(mKeys, 0, mSize, key); i = ~binarySearch(mKeys, 0, mSize, key);