1 package at.ac.tuwien.sbc.valesriegler.pizzeria.gui.tablemodels;
3 import java.util.ArrayList;
6 import at.ac.tuwien.sbc.valesriegler.common.TableModel;
7 import at.ac.tuwien.sbc.valesriegler.types.GroupData;
9 public class GroupsOverviewModel extends TableModel<GroupData> {
10 private static final String ID = "ID";
11 private static final String SIZE = "Size";
13 private static final String[] COLUMNS = new String[] { ID, SIZE };
16 protected String[] getColumns() {
21 public Object getValueAt(int rowIndex, int columnIndex) {
22 List<GroupData> values = new ArrayList<>(items.values());
23 GroupData group = values.get(rowIndex);
24 String wantedColumn = COLUMNS[columnIndex];
25 switch (wantedColumn) {
29 return group.getSize();
31 throw new RuntimeException(UNHANDLEDCOLUMN);