public Field getFieldAt(int index) { if (index < 0 || index >= length()) throw new IndexOutOfBoundsException(); int y = index / (width + 1); int x = index % (width + 1); if (x == width) return null; else return screen.getInputFieldAt(x, y); }