Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean containsKey(K key) {
- if (key == null) {
- throw new IllegalArgumentException();
- }
- int slotIndex = key.hashCode() % capacity;
- TableEntry<K, V> current = table[slotIndex];
- System.out.println();
- if (current.getKey().equals(null)) {
- return false;
- } else {
- while (current.next != null) {
- if (current.getKey().equals(key)) {
- return true;
- } else {
- current = current.next;
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement