@Test public void containsKey() { SparseArrayCompat<String> array = new SparseArrayCompat<>(); array.put(1, "one"); assertTrue(array.containsKey(1)); assertFalse(array.containsKey(2)); }
public boolean containsKey(int key) { return indexOfKey(key) >= 0; }
SparseArrayCompat implements Cloneable { public boolean containsKey(int key) { return indexOfKey(key) >= 0; } }
SparseArrayCompat implements Cloneable { public boolean containsKey(int key) { return indexOfKey(key) >= 0; } SparseArrayCompat();  SparseArrayCompat(int initialCapacity); }
SparseArrayCompat implements Cloneable { public boolean containsKey(int key) { return indexOfKey(key) >= 0; } SparseArrayCompat();  SparseArrayCompat(int initialCapacity); @Override @SuppressWarnings("unchecked") SparseArrayCompat<E> clone(); @Nullable @SuppressWarnings("NullAway") // See inline comment. E get(int key); @SuppressWarnings("unchecked") E get(int key, E valueIfKeyNotFound); @Deprecated void delete(int key); void remove(int key); boolean remove(int key, Object value); void removeAt(int index); void removeAtRange(int index, int size); @Nullable E replace(int key, E value); boolean replace(int key, E oldValue, E newValue); void put(int key, E value); void putAll(@NonNull SparseArrayCompat<? extends E> other); @Nullable E putIfAbsent(int key, E value); int size(); boolean isEmpty(); int keyAt(int index); @SuppressWarnings("unchecked") E valueAt(int index); void setValueAt(int index, E value); int indexOfKey(int key); int indexOfValue(E value); boolean containsKey(int key); boolean containsValue(E value); void clear(); void append(int key, E value); @Override String toString(); }
SparseArrayCompat implements Cloneable { public boolean containsKey(int key) { return indexOfKey(key) >= 0; } SparseArrayCompat();  SparseArrayCompat(int initialCapacity); @Override @SuppressWarnings("unchecked") SparseArrayCompat<E> clone(); @Nullable @SuppressWarnings("NullAway") // See inline comment. E get(int key); @SuppressWarnings("unchecked") E get(int key, E valueIfKeyNotFound); @Deprecated void delete(int key); void remove(int key); boolean remove(int key, Object value); void removeAt(int index); void removeAtRange(int index, int size); @Nullable E replace(int key, E value); boolean replace(int key, E oldValue, E newValue); void put(int key, E value); void putAll(@NonNull SparseArrayCompat<? extends E> other); @Nullable E putIfAbsent(int key, E value); int size(); boolean isEmpty(); int keyAt(int index); @SuppressWarnings("unchecked") E valueAt(int index); void setValueAt(int index, E value); int indexOfKey(int key); int indexOfValue(E value); boolean containsKey(int key); boolean containsValue(E value); void clear(); void append(int key, E value); @Override String toString();  }