/** * Adds a column to the simulated database table. * The column will get the specified name. * The specified data will be stored in the new column. If there * are other columns with not enough rows, the other * columns will be extended and filled with <code>null</code> * values. * @param columnName the column name * @param values the column data as <code>List</code>, the index * in the <code>List</code> corresponds to the row * index, i.e. values.get(0) will be stored in the first * row and so on */ public void addColumn(String columnName, List values) { List column = new ArrayList(values); columnMap.put(columnName, column); columnNameList.add(columnName); adjustColumns(); adjustInsertRow(); copyColumnMap(); adjustFlags(); }
/** * Adds a column to the simulated database table. * The column will get the specified name. * The specified data will be stored in the new column. If there * are other columns with not enough rows, the other * columns will be extended and filled with <code>null</code> * values. * @param columnName the column name * @param values the column data as <code>List</code>, the index * in the <code>List</code> corresponds to the row * index, i.e. values.get(0) will be stored in the first * row and so on */ public void addColumn(String columnName, List values) { List column = new ArrayList(values); columnMap.put(columnName, column); columnNameList.add(columnName); adjustColumns(); adjustInsertRow(); copyColumnMap(); adjustFlags(); }
/** * Adds a column to the simulated database table. * The column will get the specified name. * The specified data will be stored in the new column. If there * are other columns with not enough rows, the other * columns will be extended and filled with <code>null</code> * values. * @param columnName the column name * @param values the column data as <code>List</code>, the index * in the <code>List</code> corresponds to the row * index, i.e. values.get(0) will be stored in the first * row and so on */ public void addColumn(String columnName, List<Object> values) { List<Object> column = new ArrayList<Object>(values); columnMap.put(columnName, column); columnNameList.add(columnName); adjustColumns(); adjustInsertRow(); copyColumnMap(); adjustFlags(); }