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

Method get

lab08/src/hashmap/ULLMap.java:100–108  ·  view source on GitHub ↗

Returns the Node in this linked list of key-value pairs whose key is equal to KEY, or null if no such Node exists.

(K k)

Source from the content-addressed store, hash-verified

98 * is equal to KEY, or null if no such Node exists.
99 */
100 Node get(K k) {
101 if (k != null && k.equals(key)) {
102 return this;
103 }
104 if (next == null) {
105 return null;
106 }
107 return next.get(k);
108 }
109
110 /** Stores the key of the key-value pair of this node in the list. */
111 K key;

Callers

nothing calls this directly

Calls 2

getMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected