/** * Adds a row to the table. * @return index of the added column. */ public int addRow() { return table.addRow(); }
/** * Adds a row to the table. * @param tuple tuple to add to the table * @return number of rows */ public int addRow(Tuple tuple) { return this.schemaTable.addRow(tuple); }
@Override public void addRows(int arg0) { for (int i = 0; i < arg0; i++) { table.addRow(); } }
/** * Adds a row. * @return number of rows */ public int addRow() { try { return this.schemaTable.addRow(); } catch (Exception e) { throw new ObviousRuntimeException(e); } }
@Override public int addRow() { int r = table.addRow(); fireTableEvent(r, r, TableModelEvent.ALL_COLUMNS, TableModelEvent.INSERT); return r; }
@Override public void setSize(int newSize) { if (newSize <= size()) { return; } int rowToAdd = newSize - size(); for (int i = 0; i < rowToAdd; i++) { table.addRow(); } }
@Override public void ensureCapacity(int minCapacity) { if (minCapacity <= table.getRowCount()) { return; } int newRows = minCapacity - table.getRowCount(); for (int i = 0; i < newRows; i++) { table.addRow(); } }
/** * Create a node CSV file and an edge CSV file from the obvious network. * @throws ObviousxException when file creation failed */ public void createFile() throws ObviousxException { Table nodeTable = new TableImpl(nodeSchema); Table edgeTable = new TableImpl(edgeSchema); for (Node node : network.getNodes()) { nodeTable.addRow(node); } for (Edge edge : network.getEdges()) { edgeTable.addRow(edge); } CSVExport nodeExport = new CSVExport(nodeName, nodeTable); CSVExport edgeExport = new CSVExport(edgeName, edgeTable); nodeExport.createFile(); edgeExport.createFile(); }
@Override public Tuple addTuple(Tuple arg0) { Object[] values = new Object[table.getSchema().getColumnCount()]; obvious.data.Tuple obviousTuple = new TupleImpl(table.getSchema(), values); int r = table.addRow(obviousTuple); return this.getTuple(r); }
while ((nextline = reader.readNext()) != null) { if (lineCount >= HEADERSIZE) { this.table.addRow(); int rowId = this.table.getRowCount(); for (int j = 0; j < nextline.length; j++) {
int edgeId = edgeTable.addRow(); edgeToId.put(edge, edgeId); for (int i = 0; i < edgeTable.getSchema().getColumnCount(); i++) {
@Override public void add(Instance instance) { double[] values = instance.toDoubleArray(); Object[] obvValues = new Object[table.getSchema().getColumnCount()]; for (int i = 0; i < table.getSchema().getColumnCount(); i++) { Attribute att = instance.attribute(i); Class<?> c = table.getSchema().getColumnType(i); if(att.isString() && ObviousWekaUtils.isString(c)) { obvValues[i] = instance.attribute(i).value(i); } else if (att.isNumeric() && ObviousWekaUtils.isNumeric(c)) { obvValues[i] = instance.value(att); } else if (att.isDate() && ObviousWekaUtils.isDate(c)) { obvValues[i] = new Date((long) values[i]); } else { obvValues[i] = null; } } Tuple tuple = new TupleImpl(table.getSchema(), obvValues); m_Instances.addElement(new ObviousWekaInstance(tuple, this)); table.addRow(tuple); }