@Override public DataContainer<E[]> next(DataContainer<E[]> container) { beInitialized(container); if (rows.size() == 0 || columnIndex >= rows.get(0).length) return null; @SuppressWarnings("unchecked") E[] column = ArrayUtil.newInstance((Class<E>) source.getType().getComponentType(), rows.size()); for (int rowIndex = 0; rowIndex < rows.size(); rowIndex++) { E[] row = rows.get(rowIndex); column[rowIndex] = (columnIndex < row.length ? row[columnIndex] : null); } columnIndex++; return container.setData(column); }
@Override public Class<E[]> getType() { return source.getType(); }