/** * @see prefuse.data.Tuple#getSchema() */ public Schema getSchema() { return m_table.getSchema(); }
/** * Returns this Table's schema. * @return a copy of this Table's schema */ public Schema getSchema() { return new PrefuseObviousSchema(this.table.getSchema()); }
@Override public prefuse.data.Schema getSchema() { return this.getTable().getSchema(); }
/** * Query this table for a filtered, sorted subset of this table. This * operation creates an entirely new table independent of this table. * If a filtered view of this same table is preferred, use the * {@link CascadedTable} class. * @param filter the predicate filter determining which rows to include * in the new table. If this value is null, all rows will be included. * @param sort the sorting criteria determining the order in which * rows are added to the new table. If this value is null, the rows * will not be sorted. * @return a new table meeting the query specification */ public Table select(Predicate filter, Sort sort) { Table t = getSchema().instantiate(); Iterator tuples = tuples(filter, sort); while ( tuples.hasNext() ) { t.addTuple((Tuple)tuples.next()); } return t; }
/** * Sets a value. * @param rowId row to set * @param col to set * @param val to set */ public void set(int rowId, int col, Object val) { try { this.table.set(rowId, this.table.getSchema().getColumnName(col), val); this.fireTableEvent(rowId, rowId, col, TableListener.UPDATE); } catch (Exception e) { throw new ObviousRuntimeException(e); } }
/** * Create a new ExpressionColumn. * @param table the table this column is a member of * @param expr the expression used to provide the column values */ public ExpressionColumn(Table table, Expression expr) { super(expr.getType(table.getSchema())); m_table = table; m_expr = expr; m_listener = new Listener(); init(); int nRows = m_table.getRowCount(); m_cache = ColumnFactory.getColumn(getColumnType(), nRows); m_valid = new BitSet(nRows); m_expr.addExpressionListener(m_listener); }
/** * Generates a Comparator to be used for sorting tuples drawn from * the given tuple set. * @param ts the TupleSet whose Tuples are to be sorted * @return a Comparator instance for sorting tuples from the given * set using the sorting criteria given in this specification */ public Comparator getComparator(TupleSet ts) { // get the schema, so we can lookup column value types Schema s; if ( ts instanceof Table ) { // for Tables, we can get this directly s = ((Table)ts).getSchema(); } else { // if non-table tuple set is empty, we punt if ( ts.getTupleCount() == 0 ) return new NullComparator(); // otherwise, use the schema of the first tuple in the set s = ((Tuple)ts.tuples().next()).getSchema(); } // create the comparator CompositeComparator cc = new CompositeComparator(m_fields.length); for ( int i=0; i<m_fields.length; ++i ) { cc.add(new TupleComparator(m_fields[i], s.getColumnType(m_fields[i]), m_ascend[i])); } return cc; }
} else { Schema s = t.getSchema(); if ( getSchema().isAssignableFrom(s) ) { int r = addRow(); for ( int i=0; i<s.getColumnCount(); ++i ) {
Schema ns = graph.getNodeTable().getSchema(); checkTreeMLSchema(ns);