MCPcopy Create free account
hub / github.com/Berkeley-CS61B/skeleton-sp23 / Map61B

Interface Map61B

lab07/src/Map61B.java:8–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6 * necessary.
7 */
8public 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}

Callers 52

testFromSpecMethod · 0.65
handleMethod · 0.65
insertRandomMethod · 0.65
insertInOrderMethod · 0.65
insertRandomMethod · 0.65
testRemoveMethod · 0.65
testRemoveThreeCasesMethod · 0.65
sanityKeySetTestMethod · 0.65
testLetterToNumMethod · 0.65
getMethod · 0.65
putMethod · 0.65
containsKeyMethod · 0.65

Implementers 2

ULLMaplab08/src/hashmap/ULLMap.java
ULLMaplab07/src/ULLMap.java

Calls

no outgoing calls

Tested by

no test coverage detected