package uebung09.iterator;

import java.util.Iterator;

public class Array2dIterator<T> implements Iterator<T>{

    private T[][] array;
    private int index = 0;

    public Array2dIterator(T[][] array) {
        this.array = array;
    }

    @Override
    public boolean hasNext() {
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                if (array[i][j+1] != null) {
                    return true;
                }
                if (array[i+1][j] != null) {
                    return true;
                }
            }
        }
        return false;
    }

    @Override
    public T next() {
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                
            }
        }
        return null;
    }

}
