@Test public void testIterator() throws Exception { TableModel model = new DynamicTableModel(2, 2); RectF tableRect = new RectF(0, 0, 1000, 2000); Iterator<RectF> it = model.getIterator(tableRect, 10); int iterations = 0; while(it.hasNext()) { it.next(); iterations++; } assertEquals(4, iterations); model = new DynamicTableModel(2, 0); it = model.getIterator(tableRect, 10); iterations = 0; while(it.hasNext()) { it.next(); iterations++; } assertEquals(10, iterations); }
@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);  }