/** * Check if the given data field can return primitive <code>double</code> * values. * @param field the data field to check * @return true if the data field can return primitive <code>double</code> * values, false otherwise. If true, the {@link #getDouble(String)} method * can be used safely. */ public boolean canGetDouble(String field) { return tuple.canGetDouble(field); }
/** * @see prefuse.data.expression.Expression#get(prefuse.data.Tuple) */ public Object get(Tuple t) { return t.get(m_field); }
/** * @see prefuse.data.expression.Expression#getBoolean(prefuse.data.Tuple) */ public boolean getBoolean(Tuple t) { return t.getBoolean(m_field); }
/** * Get the data value at the given column number as an Object. * @param col the column number * @return the data value as an Object. The concrete type of this * Object is dependent on the underlying data column used. * @see #canGet(String, Class) * @see #getColumnType(int) */ public Object get(int col) { return tuple.get(this.tuple.getSchema().getColumnName(col)); }
/** * Indicates if this table contains the given Tuple instance. * @param t the Tuple to check for containment * @return true if the Tuple represents a row of this table, false if * it does not * @see prefuse.data.tuple.TupleSet#containsTuple(prefuse.data.Tuple) */ public boolean containsTuple(Tuple t) { return (t.getTable()==this && isValidRow(t.getRow())); }
if ( m_type == int.class || m_type == byte.class ) { c = ((LiteralComparator)m_cmp).compare( t1.getInt(m_field), t2.getInt(m_field)); } else if ( m_type == double.class ) { c = ((LiteralComparator)m_cmp).compare( t1.getDouble(m_field), t2.getDouble(m_field)); } else if ( m_type == long.class ) { c = ((LiteralComparator)m_cmp).compare( t1.getLong(m_field), t2.getLong(m_field)); } else if ( m_type == float.class ) { c = ((LiteralComparator)m_cmp).compare( t1.getFloat(m_field), t2.getFloat(m_field)); } else if ( m_type == boolean.class ) { c = ((LiteralComparator)m_cmp).compare( t1.getBoolean(m_field), t2.getBoolean(m_field)); } else if ( !m_type.isPrimitive() ) { c = m_cmp.compare(t1.get(m_field), t2.get(m_field)); } else { throw new IllegalStateException( if ( m_type == int.class || m_type == byte.class ) { c = ((LiteralComparator)m_cmp).compare( t1.getInt(m_col), t2.getInt(m_col)); } else if ( m_type == double.class ) { c = ((LiteralComparator)m_cmp).compare( t1.getDouble(m_col), t2.getDouble(m_col)); } else if ( m_type == long.class ) { c = ((LiteralComparator)m_cmp).compare( t1.getLong(m_col), t2.getLong(m_col));
/** * Returns the row index for this Tuple's backing Table, if it exists. * @return the backing row index, or -1 if there is no backing table * or if this Tuple has been invalidated (i.e., the Tuple's row was * deleted from the backing table). */ public int getRow() { return tuple.getRow(); }
/** * Get the data value at the given field as a <code>double</code>. * @param field the data field to retrieve * @see #canGetDouble(String) * @return double */ public double getDouble(String field) { return tuple.getDouble(field); }
/** * Returns the schema for this tuple's data. * @return the Tuple Schema */ public Schema getSchema() { return new PrefuseObviousSchema(tuple.getSchema()); }
/** * @see prefuse.data.expression.Expression#getInt(prefuse.data.Tuple) */ public int getInt(Tuple t) { return t.getInt(m_field); }
/** * @see prefuse.data.expression.Expression#getFloat(prefuse.data.Tuple) */ public float getFloat(Tuple t) { return t.getFloat(m_field); }
/** * @see prefuse.data.expression.Expression#getLong(prefuse.data.Tuple) */ public long getLong(Tuple t) { return t.getLong(m_field); }
/** * Gets column type. * @param field to inspect * @return type of the field */ public Class<?> getColumnType(String field) { return tuple.getColumnType(field); }
Class type = t.getColumnType(field); if ( type == int.class ) return new NumericLiteral(t.getInt(field)); return new NumericLiteral(t.getLong(field)); return new NumericLiteral(t.getFloat(field)); return new NumericLiteral(t.getDouble(field)); return new BooleanLiteral(t.getBoolean(field)); return new ObjectLiteral(t.get(field));
public int getInt(Tuple t) { return t.getRow(); } }
/** * @see prefuse.data.expression.Expression#getDouble(prefuse.data.Tuple) */ public double getDouble(Tuple t) { return t.getDouble(m_field); }
/** * @see prefuse.data.expression.Expression#get(prefuse.data.Tuple) */ public Object get(Tuple t) { Class type = getType(t.getSchema()); if ( int.class == type || byte.class == type ) { return new Integer(getInt(t)); } else if ( long.class == type ) { return new Long(getInt(t)); } else if ( float.class == type ) { return new Float(getFloat(t)); } else if ( double.class == type ) { return new Double(getDouble(t)); } else { throw new IllegalStateException(); } }
/** * Get the data value at the given field as an <code>int</code>. * @param field the data field to retrieve * @see #canGetInt(String) * @return int */ public int getInt(String field) { return tuple.getInt(field); }
/** * Get the data value at the given field as a <code>float</code>. * @param field the data field to retrieve * @see #canGetFloat(String) * @return float */ public float getFloat(String field) { return tuple.getFloat(field); }