|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.data.column.AbstractColumn prefuse.data.column.ExpressionColumn
public class ExpressionColumn
Column instance that stores values provided by an Expression instance. These expressions can reference other column values within the same table. Values are evaluated when first requested and then cached to increase performance. This column maintains listeners for all referenced columns discovered in the expression and for the expression itself, invalidating all cached entries when an update to either occurs.
WARNING: Infinite recursion, eventually resulting in a StackOverflowError, could occur if an expression refers to its own column, or if two ExpressionColumns have expressions referring to each other. The responsibility for avoiding such situations is left with client programmers. Note that it is fine for one ExpressionColumn to reference another; however, the graph induced by such references must not contain any cycles.
prefuse.data.expression
Field Summary |
---|
Fields inherited from class prefuse.data.column.AbstractColumn |
---|
m_columnType, m_defaultValue, m_listeners, m_parser, m_readOnly |
Constructor Summary | |
---|---|
ExpressionColumn(Table table,
Expression expr)
Create a new ExpressionColumn. |
Method Summary | |
---|---|
boolean |
canSet(java.lang.Class type)
Indicates if the set method can be called without an exception being thrown for the given type. |
java.lang.Object |
get(int row)
Get the data value at the specified row |
boolean |
getBoolean(int row)
Get the data value at the specified row as a boolean |
double |
getDouble(int row)
Get the data value at the specified row as a double |
float |
getFloat(int row)
Get the data value at the specified row as a float |
int |
getInt(int row)
Get the data value at the specified row as an integer |
long |
getLong(int row)
Get the data value at the specified row as a long |
int |
getRowCount()
Returns the number of rows in this data column |
protected void |
init()
|
void |
invalidateCache(int start,
int end)
Invalidate a range of the cache. |
boolean |
isCacheValid(int row)
Check if this ExpressionColumn has a valid cached value at the given row. |
void |
revertToDefault(int row)
Has no effect, as all values in this column are derived. |
void |
set(java.lang.Object val,
int row)
Set the data value at the specified row |
void |
setMaximumRow(int nrows)
Sets the number of rows in this data column |
Methods inherited from class prefuse.data.column.AbstractColumn |
---|
addColumnListener, canGet, canGetBoolean, canGetDate, canGetDouble, canGetFloat, canGetInt, canGetLong, canGetString, canSetBoolean, canSetDate, canSetDouble, canSetFloat, canSetInt, canSetLong, canSetString, fireColumnEvent, fireColumnEvent, fireColumnEvent, fireColumnEvent, fireColumnEvent, fireColumnEvent, fireColumnEvent, getColumnType, getDate, getDefaultValue, getParser, getString, isCellEditable, isReadOnly, removeColumnListener, setBoolean, setDate, setDefaultValue, setDouble, setFloat, setInt, setLong, setParser, setReadOnly, setString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExpressionColumn(Table table, Expression expr)
table
- the table this column is a member ofexpr
- the expression used to provide the column valuesMethod Detail |
---|
protected void init()
public int getRowCount()
Column
Column.getRowCount()
public void setMaximumRow(int nrows)
Column
nrows
- the number of rowsColumn.setMaximumRow(int)
public boolean isCacheValid(int row)
row
- the row to check for a valid cache entry
public void invalidateCache(int start, int end)
start
- the start of the range to invalidateend
- the end of the range to invalidate, inclusivepublic void revertToDefault(int row)
revertToDefault
in interface Column
revertToDefault
in class AbstractColumn
row
- the row to revertpublic boolean canSet(java.lang.Class type)
AbstractColumn
canSet
in interface Column
canSet
in class AbstractColumn
type
- the Class of the data type to check
AbstractColumn.canSet(java.lang.Class)
public java.lang.Object get(int row)
Column
row
- the row from which to retrieve the value
Column.get(int)
public void set(java.lang.Object val, int row) throws DataTypeException
Column
val
- the value to setrow
- the row at which to set the value
DataTypeException
Column.set(java.lang.Object, int)
public boolean getBoolean(int row) throws DataTypeException
AbstractColumn
getBoolean
in interface Column
getBoolean
in class AbstractColumn
row
- the row from which to retrieve the value
DataTypeException
- if this column does not
support the boolean typeColumn.getBoolean(int)
public int getInt(int row) throws DataTypeException
AbstractColumn
getInt
in interface Column
getInt
in class AbstractColumn
row
- the row from which to retrieve the value
DataTypeException
- if this column does not
support the integer typeColumn.getInt(int)
public double getDouble(int row) throws DataTypeException
AbstractColumn
getDouble
in interface Column
getDouble
in class AbstractColumn
row
- the row from which to retrieve the value
DataTypeException
- if this column does not
support the double typeColumn.getDouble(int)
public float getFloat(int row) throws DataTypeException
AbstractColumn
getFloat
in interface Column
getFloat
in class AbstractColumn
row
- the row from which to retrieve the value
DataTypeException
- if this column does not
support the float typeColumn.getFloat(int)
public long getLong(int row) throws DataTypeException
AbstractColumn
getLong
in interface Column
getLong
in class AbstractColumn
row
- the row from which to retrieve the value
DataTypeException
- if this column does not
support the long typeColumn.getLong(int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |