public Item<K, V> next() { if (branch) { return branch1.next(); } if (branch0.hasNext()) { return branch0.next(); } branch = true; return branch1.next(); }
public boolean hasNext() { while (next == null) { if (tableIdx == table.array.length() && tableIterator == null) { return false; } if (tableIterator == null) { int rowIdx = tableIdx++; if (table.array.get(rowIdx) != null) { tableIterator = createRowIterator(table, rowIdx); } } if (tableIterator != null) { if (tableIterator.hasNext()) { next = tableIterator.next(); return true; } else { tableIterator = null; } } } return true; }