@Test public void testColumnMajorIteration() throws Exception { TableModel model = new DynamicTableModel(2, 2, TableOrder.COLUMN_MAJOR); RectF tableRect = new RectF(0, 0, 1000, 2000); int createdCells = 4; Iterator<RectF> it = model.getIterator(tableRect, createdCells); RectF cellRect = it.next(); assertEquals(500f, cellRect.width()); assertEquals(1000f, cellRect.height()); assertEquals(0f, cellRect.left); assertEquals(0f, cellRect.top); assertEquals(500f, cellRect.right); assertEquals(1000f, cellRect.bottom); cellRect = it.next(); assertEquals(500f, cellRect.width()); assertEquals(1000f, cellRect.height()); assertEquals(0f, cellRect.left); assertEquals(1000f, cellRect.top); assertEquals(500f, cellRect.right); assertEquals(2000f, cellRect.bottom); cellRect = it.next(); assertEquals(500f, cellRect.width()); assertEquals(1000f, cellRect.height()); assertEquals(500f, cellRect.left); assertEquals(0f, cellRect.top); assertEquals(1000f, cellRect.right); assertEquals(1000f, cellRect.bottom); cellRect = it.next(); assertEquals(500f, cellRect.width()); assertEquals(1000f, cellRect.height()); assertEquals(500f, cellRect.left); assertEquals(1000f, cellRect.top); assertEquals(1000f, cellRect.right); assertEquals(2000f, cellRect.bottom); }
@Override public TableModelIterator getIterator(RectF tableRect, int totalElements) { return new TableModelIterator(this, tableRect, totalElements); }
DynamicTableModel extends TableModel { @Override public TableModelIterator getIterator(RectF tableRect, int totalElements) { return new TableModelIterator(this, tableRect, totalElements); } }
DynamicTableModel extends TableModel { @Override public TableModelIterator getIterator(RectF tableRect, int totalElements) { return new TableModelIterator(this, tableRect, totalElements); } DynamicTableModel(int numColumns, int numRows);  DynamicTableModel(int numColumns, int numRows, TableOrder order); }
DynamicTableModel extends TableModel { @Override public TableModelIterator getIterator(RectF tableRect, int totalElements) { return new TableModelIterator(this, tableRect, totalElements); } DynamicTableModel(int numColumns, int numRows);  DynamicTableModel(int numColumns, int numRows, TableOrder order); @Override TableModelIterator getIterator(RectF tableRect, int totalElements); RectF getCellRect(RectF tableRect, int numElements); int getNumRows(); void setNumRows(int numRows); int getNumColumns(); void setNumColumns(int numColumns); }
DynamicTableModel extends TableModel { @Override public TableModelIterator getIterator(RectF tableRect, int totalElements) { return new TableModelIterator(this, tableRect, totalElements); } DynamicTableModel(int numColumns, int numRows);  DynamicTableModel(int numColumns, int numRows, TableOrder order); @Override TableModelIterator getIterator(RectF tableRect, int totalElements); RectF getCellRect(RectF tableRect, int numElements); int getNumRows(); void setNumRows(int numRows); int getNumColumns(); void setNumColumns(int numColumns);  }