Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean hasNext() {
- if (c<cap) return true;
- return false;
- }
- @Override
- public TableEntry<K, V> next() {
- if (hasNext()) {
- if (current != null && current.next != null) {
- TableEntry<K,V> h = current;
- current = current.next;
- c++;
- return h;
- }
- if (current != null && current.next == null) {
- TableEntry<K,V> h1 = current;
- for (int i = ind+1; i<size; i++) {
- if (table[i] !=null) {
- current = table[i];
- ind = i;
- c++;
- return h1;
- }
- }
- }
- if (current == null) {
- for (int i = ind; i<size; i++) {
- if (table[i] != null) {
- ind = i;
- c++;
- current = table[i];
- return current;
- }
- }
- }
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement