@Override public String getColumnName(int arg0) { return tuple.getSchema().getColumnName(arg0); }
@Override public String getName() { return table.getSchema().getColumnName(id); }
/** * Gets the name of a column. * @param columnIndex index of the column * @return name of the column */ public String getColumnName(int columnIndex) { return table.getSchema().getColumnName(columnIndex); }
/** * Returns the name of the column at columnIndex. * This is used to initialize the table's column header name. * Note: this name does not need to be unique; two columns * in a table can have the same name. * @param columnIndex the index of the column * @return the name of the column */ public String getColumnName(int columnIndex) { return this.table.getSchema().getColumnName(columnIndex); }
@Override public boolean isInternal() { return table.getSchema().getColumnName(id) != null && table.getSchema().getColumnName(id).length() != 0 && table.getSchema().getColumnName(id).charAt(0) == '#'; }
@Override public boolean getBoolean(int col) { if (canGetBoolean(schema.getColumnName(col))) { return (Boolean) get(col); } return (Boolean) null; }
@Override public void setString(int col, String val) { if (canSetString(schema.getColumnName(col))) { set(col, val); } }
@Override public float getFloat(int col) { if (canGetFloat(schema.getColumnName(col))) { return (Float) get(col); } return (Float) null; }
@Override public String getString(int col) { if (canGetString(schema.getColumnName(col))) { return (String) get(col); } return (String) null; }
@Override public Date getDate(int col) { if (canGetDate(schema.getColumnName(col))) { return (Date) get(col); } return null; }
@Override public void setDouble(int col, double val) { if (canSetDouble(schema.getColumnName(col))) { set(col, val); } }
@Override public void setLong(int col, long val) { if (canSetLong(schema.getColumnName(col))) { set(col, val); } }
@Override public double getDouble(int col) { if (canGetDouble(schema.getColumnName(col))) { return (Double) get(col); } return (Double) null; }
@Override public long getLong(int col) { if (canGetLong(schema.getColumnName(col))) { return (Long) get(col); } return (Long) null; }
@Override public void setBoolean(int col, boolean val) { if (canSetBoolean(schema.getColumnName(col))) { set(col, val); } }
@Override public void setDate(int col, Date val) { if (canSetDate(schema.getColumnName(col))) { set(col, val); } }
@Override public void setInt(int col, int val) { if (canSetInt(schema.getColumnName(col))) { set(col, val); } }
/** * Constructor that used Obvious Schema to wrap Prefuse Tables. * @param schema original obvious schema for the table */ public PrefuseObviousTable(Schema schema) { this.table = new prefuse.data.Table(0, schema.getColumnCount()); this.listener = new ArrayList<TableListener>(); for (int i = 0; i < schema.getColumnCount(); i++) { this.table.addColumn(schema.getColumnName(i), schema.getColumnType(i), schema.getColumnDefault(i)); } }
protected Instances createInstances() { FastVector attributes = new FastVector(); for (int i = 0; i < schema.getColumnCount(); i++) { Attribute attribute = createAttribute(schema.getColumnName(i), schema.getColumnType(i)); attributes.addElement(attribute); } return new Instances("test", attributes, 1); }
/** * Constructor. * @param inTable wrapped obvious table */ public WrapToPrefTable(Table inTable) { this.table = inTable; for (int i = 0; i < table.getSchema().getColumnCount(); i++) { addColumn(table.getSchema().getColumnName(i), table.getSchema().getColumnType(i), table.getSchema().getColumnDefault(i)); } m_rows = new WrapToPrefRowManager(this); }