Advertisement
Guest User

Untitled

a guest
Aug 27th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. @Override
  2.         public boolean hasNext() {
  3.             if (c<cap) return true;
  4.             return false;
  5.         }
  6.  
  7.         @Override
  8.         public TableEntry<K, V> next() {
  9.             if (hasNext()) {
  10.                 if (current != null && current.next != null) {
  11.                     TableEntry<K,V> h = current;
  12.                     current = current.next;
  13.                     c++;
  14.                     return h;
  15.                 }
  16.                 if (current != null && current.next == null) {
  17.                     TableEntry<K,V> h1 = current;
  18.                     for (int i = ind+1; i<size; i++) {
  19.                         if (table[i] !=null) {
  20.                             current = table[i];
  21.                             ind = i;
  22.                             c++;
  23.                             return h1;
  24.                         }
  25.                     }
  26.                 }
  27.                 if (current == null) {
  28.                     for (int i = ind; i<size; i++) {
  29.                         if (table[i] != null) {
  30.                             ind = i;
  31.                             c++;
  32.                             current = table[i];
  33.                             return current;
  34.                         }
  35.                     }
  36.                 }
  37.             }
  38.             return null;
  39.         }
  40.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement