MCPcopy Create free account
hub / github.com/careercup/ctci / Cell

Class Cell

java/Chapter 8/Question8_10/Cell.java:3–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1package Question8_10;
2
3public class Cell<K, V> {
4 private K key;
5 private V value;
6 public Cell(K k, V v) {
7 key = k;
8 value = v;
9 }
10
11 public boolean equivalent(Cell<K, V> c) {
12 return equivalent(c.getKey());
13 }
14
15 public boolean equivalent(K k) {
16 return key.equals(k);
17 }
18
19 @Override
20 public String toString() {
21 return "(" + key.toString() + ", " + value.toString() + ")";
22 }
23
24 public K getKey() {
25 return key;
26 }
27
28 public V getValue() {
29 return value;
30 }
31}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected