private void computeNumber(int row) { if ( m_columnType == int.class || m_columnType == byte.class ) { m_cache.setInt(m_expr.getInt(m_table.getTuple(row)), row); } else if ( m_columnType == long.class ) { m_cache.setLong(m_expr.getLong(m_table.getTuple(row)), row); } else if ( m_columnType == float.class ) { m_cache.setFloat(m_expr.getFloat(m_table.getTuple(row)), row); } else { m_cache.setDouble(m_expr.getDouble(m_table.getTuple(row)), row); } m_valid.set(row); }
private int advance() { while ( rows.hasNext() ) { int r = rows.nextInt(); if ( predicate.getBoolean(t.getTuple(r)) ) { return r; } } rows = null; next = -1; return -1; }
/** * @see prefuse.data.column.Column#get(int) */ public Object get(int row) { rangeCheck(row); if ( isCacheValid(row) ) { return m_cache.get(row); } Object val = m_expr.get(m_table.getTuple(row)); Class type = val==null ? Object.class : val.getClass(); if ( m_cache.canSet(type) ) { m_cache.set(val, row); m_valid.set(row); } return val; }
/** * @see prefuse.visual.DecoratorItem#getDecoratedItem() */ public VisualItem getDecoratedItem() { VisualTable vt = (VisualTable)getTable(); int prow = vt.getParentRow(getRow()); return (VisualItem)vt.getParentTable().getTuple(prow); }
/** * Get the Tuple with the minimum data field value. * @param tuples a TupleSet * @param field the column / data field name * @return the Tuple with the minimum data field value */ public static Tuple min(TupleSet tuples, String field, Comparator cmp) { if ( tuples instanceof Table ) { Table table = (Table)tuples; ColumnMetadata md = table.getMetadata(field); return table.getTuple(md.getMinimumRow()); } else { return min(tuples.tuples(), field, cmp); } }
/** * Get the Tuple with the maximum data field value. * @param tuples a TupleSet * @param field the column / data field name * @return the Tuple with the maximum data field value */ public static Tuple max(TupleSet tuples, String field, Comparator cmp) { if ( tuples instanceof Table ) { Table table = (Table)tuples; ColumnMetadata md = table.getMetadata(field); return table.getTuple(md.getMaximumRow()); } else { return max(tuples.tuples(), field, cmp); } }
/** * Get the Tuple with the median data field value. * @param tuples a TupleSet * @param field the column / data field name * @return the Tuple with the median data field value */ public static Tuple median(TupleSet tuples, String field, Comparator cmp) { if ( tuples instanceof Table ) { Table table = (Table)tuples; ColumnMetadata md = table.getMetadata(field); return table.getTuple(md.getMedianRow()); } else { return median(tuples.tuples(), field, cmp); } }
/** * @see prefuse.data.column.Column#getBoolean(int) */ public boolean getBoolean(int row) throws DataTypeException { if ( !canGetBoolean() ) throw new DataTypeException(boolean.class); rangeCheck(row); if ( isCacheValid(row) ) { return m_cache.getBoolean(row); } else { boolean value = m_expr.getBoolean(m_table.getTuple(row)); m_cache.setBoolean(value, row); m_valid.set(row); return value; } }
/** * Fire a Tuple event. * @param t the Table on which the event has occurred * @param start the first row changed * @param end the last row changed * @param type the type of event, one of * {@link prefuse.data.event.EventConstants#INSERT} or * {@link prefuse.data.event.EventConstants#DELETE}. */ protected void fireTupleEvent(Table t, int start, int end, int type) { if ( m_tupleListeners != null && m_tupleListeners.size() > 0 ) { Object[] listeners = m_tupleListeners.getArray(); Tuple[] tuples = new Tuple[end-start+1]; for ( int i=0, r=start; r <= end; ++r, ++i ) { tuples[i] = t.getTuple(r); } for ( int i=0; i<listeners.length; ++i ) { TupleSetListener tsl = (TupleSetListener)listeners[i]; if ( type == EventConstants.INSERT ) { tsl.tupleSetChanged(this, tuples, EMPTY_ARRAY); } else { tsl.tupleSetChanged(this, EMPTY_ARRAY, tuples); } } } }
int crow = crows.nextInt(); if ( !m_rowFilter.getBoolean( m_parent.getTuple(rowMan.getParentRow(crow))) )
if ( (cr=rowMan.getChildRow(r)) != -1 ) { if ( m_rowFilter.getBoolean(m_parent.getTuple(r)) ) { if ( m_rowFilter.getBoolean(m_parent.getTuple(r)) ) { if ( rowMan.getChildRow(r) < 0 ) addCascadedRow(r); if ( m_rowFilter.getBoolean(m_parent.getTuple(r)) ) { if ( rowMan.getChildRow(r) < 0 ) addCascadedRow(r);
this.set(r, field, t.get(i)); return getTuple(r); } else { return null;
return t.getTuple(row);