maven compiles all tests independetly of which tests are run

This commit is contained in:
2026-03-03 01:02:23 +01:00
parent f2db063e5c
commit 86a691b044
76 changed files with 321 additions and 38 deletions

View File

@@ -0,0 +1,35 @@
package oving5.stringgrid;
public class StringGridIterator {
private StringGrid grid;
private boolean rowMajor;
private int i = -1;
public StringGridIterator(StringGrid grid, boolean rowMajor) {
this.grid = grid;
this.rowMajor = rowMajor;
}
public boolean hasNext() {
return (i + 1) < (grid.getRowCount() * grid.getColumnCount());
}
public String next() {
if (hasNext()) {
i += 1;
if (rowMajor) {
return grid.getElement(i / grid.getColumnCount(), i % grid.getColumnCount());
} else {
return grid.getElement(i % grid.getRowCount(), i / grid.getRowCount());
}
}
throw new IllegalArgumentException();
}
public void remove() {
throw new UnsupportedOperationException();
}
}