| 6 | * necessary. |
| 7 | */ |
| 8 | public interface Map61B<K, V> extends Iterable<K> { |
| 9 | |
| 10 | /** Associates the specified value with the specified key in this map. |
| 11 | * If the map already contains the specified key, replaces the key's mapping |
| 12 | * with the value specified. */ |
| 13 | void put(K key, V value); |
| 14 | |
| 15 | /** Returns the value to which the specified key is mapped, or null if this |
| 16 | * map contains no mapping for the key. */ |
| 17 | V get(K key); |
| 18 | |
| 19 | /** Returns whether this map contains a mapping for the specified key. */ |
| 20 | boolean containsKey(K key); |
| 21 | |
| 22 | |
| 23 | /** Returns the number of key-value mappings in this map. */ |
| 24 | int size(); |
| 25 | |
| 26 | /** Removes every mapping from this map. */ |
| 27 | void clear(); |
| 28 | |
| 29 | /** Returns a Set view of the keys contained in this map. Not required for Lab 7. |
| 30 | * If you don't implement this, throw an UnsupportedOperationException. */ |
| 31 | Set<K> keySet(); |
| 32 | |
| 33 | /** Removes the mapping for the specified key from this map if present, |
| 34 | * or null if there is no such mapping. |
| 35 | * Not required for Lab 7. If you don't implement this, throw an |
| 36 | * UnsupportedOperationException. */ |
| 37 | V remove(K key); |
| 38 | } |
no outgoing calls
no test coverage detected