
aQute.lib.justif.Table Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aQute.libg Show documentation
Show all versions of aQute.libg Show documentation
A library to be statically linked. Contains many small utilities. This bundle should not be installed in a framework, it is compile only.
package aQute.lib.justif;
import java.util.ArrayList;
import java.util.List;
public class Table {
int row;
int column;
int maxColumn = 0;
List> matrix = new ArrayList>();
public Justif nextCell(String format, Object args) {
return cell(row, column++);
}
public Justif firstCell() {
return cell(row++, column = 0);
}
private Justif cell(int row, int column) {
while (matrix.size() <= row)
matrix.add(new ArrayList());
List line = matrix.get(row);
while (line.size() <= column) {
line.add(new Justif());
maxColumn = Math.max(line.size(), maxColumn);
}
return line.get(column);
}
public void append(Appendable app) {
for (int r = 0; r < matrix.size(); r++) {
List line = matrix.get(r);
for (int c = 0; c < line.size(); c++) {
}
}
}
}