|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.data.column.AbstractColumn
public abstract class AbstractColumn
Abstract base class for Column implementations. Provides listener support and default implementations of column methods.
Field Summary | |
---|---|
protected java.lang.Class |
m_columnType
|
protected java.lang.Object |
m_defaultValue
|
protected CopyOnWriteArrayList |
m_listeners
|
protected DataParser |
m_parser
|
protected boolean |
m_readOnly
|
Constructor Summary | |
---|---|
AbstractColumn()
Create a new AbstractColumn of type Object. |
|
AbstractColumn(java.lang.Class columnType)
Create a new AbstractColumn of a given type. |
|
AbstractColumn(java.lang.Class columnType,
java.lang.Object defaultValue)
Create a new AbstractColumn of a given type. |
Method Summary | |
---|---|
void |
addColumnListener(ColumnListener listener)
Adds a listener to be notified when this column changes |
boolean |
canGet(java.lang.Class type)
Indicates if the get method can be called without an exception being thrown for the given type. |
boolean |
canGetBoolean()
Indicates if convenience get method can be called without an exception being thrown for the boolean type. |
boolean |
canGetDate()
Indicates if convenience get method can be called without an exception being thrown for the Date type. |
boolean |
canGetDouble()
Indicates if convenience get method can be called without an exception being thrown for the double type. |
boolean |
canGetFloat()
Indicates if convenience get method can be called without an exception being thrown for the float type. |
boolean |
canGetInt()
Indicates if convenience get method can be called without an exception being thrown for the int type. |
boolean |
canGetLong()
Indicates if convenience get method can be called without an exception being thrown for the long type. |
boolean |
canGetString()
Indicates if convenience get method can be called without an exception being thrown for the String type. |
boolean |
canSet(java.lang.Class type)
Indicates if the set method can be called without an exception being thrown for the given type. |
boolean |
canSetBoolean()
Indicates if convenience set method can be called without an exception being thrown for the boolean type. |
boolean |
canSetDate()
Indicates if convenience set method can be called without an exception being thrown for the Date type. |
boolean |
canSetDouble()
Indicates if convenience set method can be called without an exception being thrown for the double type. |
boolean |
canSetFloat()
Indicates if convenience set method can be called without an exception being thrown for the float type. |
boolean |
canSetInt()
Indicates if convenience set method can be called without an exception being thrown for the int type. |
boolean |
canSetLong()
Indicates if convenience set method can be called without an exception being thrown for the long type. |
boolean |
canSetString()
Indicates if convenience set method can be called without an exception being thrown for the String type. |
protected void |
fireColumnEvent(int idx,
boolean prev)
Notifies all registered listeners of a column UPDATE event |
protected void |
fireColumnEvent(int idx,
double prev)
Notifies all registered listeners of a column UPDATE event |
protected void |
fireColumnEvent(int idx,
float prev)
Notifies all registered listeners of a column UPDATE event |
protected void |
fireColumnEvent(int idx,
int prev)
Notifies all registered listeners of a column UPDATE event |
protected void |
fireColumnEvent(int type,
int start,
int end)
Notifies all registered listeners of a column UPDATE event |
protected void |
fireColumnEvent(int idx,
long prev)
Notifies all registered listeners of a column UPDATE event |
protected void |
fireColumnEvent(int idx,
java.lang.Object prev)
Notifies all registered listeners of a column UPDATE event |
boolean |
getBoolean(int row)
Get the data value at the specified row as a boolean |
java.lang.Class |
getColumnType()
Returns the most specific superclass for the values in the column |
java.util.Date |
getDate(int row)
Get the data value at the specified row as a Date |
java.lang.Object |
getDefaultValue()
Returns the default value for rows that have not been set explicitly. |
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 |
DataParser |
getParser()
Get the data parser used to map String values to and from the values stored by this Column. |
java.lang.String |
getString(int row)
Get the data value at the specified row as a String |
boolean |
isCellEditable(int row)
Indicates if the value at the given row can be edited. |
boolean |
isReadOnly()
Indicates if the values in this column are read-only. |
void |
removeColumnListener(ColumnListener listener)
Removes a listener, causing it to no longer be notified of changes |
void |
revertToDefault(int row)
Reverts the specified row back to the column's default value. |
void |
setBoolean(boolean val,
int row)
Set the data value at the specified row as a boolean |
void |
setDate(java.util.Date val,
int row)
Set the data value at the specified row as a Date |
void |
setDefaultValue(java.lang.Object dflt)
Sets the default value for this column. |
void |
setDouble(double val,
int row)
Set the data value at the specified row as a double |
void |
setFloat(float val,
int row)
Set the data value at the specified row as a float |
void |
setInt(int val,
int row)
Set the data value at the specified row as an integer |
void |
setLong(long val,
int row)
Set the data value at the specified row as a long |
void |
setParser(DataParser parser)
Set the data parser used to map String values to and from the values stored by this Column. |
void |
setReadOnly(boolean readOnly)
Sets if the values in this column are read-only |
void |
setString(java.lang.String val,
int row)
Set the data value at the specified row as a String |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface prefuse.data.column.Column |
---|
get, getRowCount, set, setMaximumRow |
Field Detail |
---|
protected final java.lang.Class m_columnType
protected DataParser m_parser
protected java.lang.Object m_defaultValue
protected boolean m_readOnly
protected CopyOnWriteArrayList m_listeners
Constructor Detail |
---|
public AbstractColumn()
public AbstractColumn(java.lang.Class columnType)
columnType
- the data type stored by this columnpublic AbstractColumn(java.lang.Class columnType, java.lang.Object defaultValue)
columnType
- the data type stored by this columndefaultValue
- the default data value to useMethod Detail |
---|
public boolean isReadOnly()
isReadOnly
in interface Column
public void setReadOnly(boolean readOnly)
setReadOnly
in interface Column
readOnly
- true to ensure the values can not be edited,
false otherwisepublic boolean isCellEditable(int row)
isCellEditable
in interface Column
row
- the row to check
public java.lang.Class getColumnType()
getColumnType
in interface Column
public DataParser getParser()
Column
getParser
in interface Column
Column.getParser()
public void setParser(DataParser parser)
Column
setParser
in interface Column
parser
- the DataParser to useColumn.setParser(prefuse.data.parser.DataParser)
public void addColumnListener(ColumnListener listener)
addColumnListener
in interface Column
listener
- the ColumnListener to addpublic void removeColumnListener(ColumnListener listener)
removeColumnListener
in interface Column
listener
- the ColumnListener to removeprotected final void fireColumnEvent(int type, int start, int end)
protected final void fireColumnEvent(int idx, int prev)
idx
- the row index of the column that was updatedprev
- the previous value at the given indexprotected final void fireColumnEvent(int idx, long prev)
idx
- the row index of the column that was updatedprev
- the previous value at the given indexprotected final void fireColumnEvent(int idx, float prev)
idx
- the row index of the column that was updatedprev
- the previous value at the given indexprotected final void fireColumnEvent(int idx, double prev)
idx
- the row index of the column that was updatedprev
- the previous value at the given indexprotected final void fireColumnEvent(int idx, boolean prev)
idx
- the row index of the column that was updatedprev
- the previous value at the given indexprotected final void fireColumnEvent(int idx, java.lang.Object prev)
idx
- the row index of the column that was updatedprev
- the previous value at the given indexpublic java.lang.Object getDefaultValue()
getDefaultValue
in interface Column
public void setDefaultValue(java.lang.Object dflt)
dflt
- public void revertToDefault(int row)
revertToDefault
in interface Column
row
- public boolean canGet(java.lang.Class type)
canGet
in interface Column
type
- the Class of the data type to check
public boolean canSet(java.lang.Class type)
canSet
in interface Column
type
- the Class of the data type to check
public boolean canGetInt()
canGetInt
in interface Column
public boolean canSetInt()
canSetInt
in interface Column
public int getInt(int row) throws DataTypeException
getInt
in interface Column
row
- the row from which to retrieve the value
DataTypeException
- if this column does not
support the integer typepublic void setInt(int val, int row) throws DataTypeException
setInt
in interface Column
val
- the value to setrow
- the row at which to set the value
DataTypeException
- if this column does not
support the integer typepublic boolean canGetLong()
canGetLong
in interface Column
public boolean canSetLong()
canSetLong
in interface Column
public long getLong(int row) throws DataTypeException
getLong
in interface Column
row
- the row from which to retrieve the value
DataTypeException
- if this column does not
support the long typepublic void setLong(long val, int row) throws DataTypeException
setLong
in interface Column
val
- the value to setrow
- the row at which to set the value
DataTypeException
- if this column does not
support the long typepublic boolean canGetFloat()
canGetFloat
in interface Column
public boolean canSetFloat()
canSetFloat
in interface Column
public float getFloat(int row) throws DataTypeException
getFloat
in interface Column
row
- the row from which to retrieve the value
DataTypeException
- if this column does not
support the float typepublic void setFloat(float val, int row) throws DataTypeException
setFloat
in interface Column
val
- the value to setrow
- the row at which to set the value
DataTypeException
- if this column does not
support the float typepublic boolean canGetDouble()
canGetDouble
in interface Column
public boolean canSetDouble()
canSetDouble
in interface Column
public double getDouble(int row) throws DataTypeException
getDouble
in interface Column
row
- the row from which to retrieve the value
DataTypeException
- if this column does not
support the double typepublic void setDouble(double val, int row) throws DataTypeException
setDouble
in interface Column
val
- the value to setrow
- the row at which to set the value
DataTypeException
- if this column does not
support the double typepublic boolean canGetBoolean()
canGetBoolean
in interface Column
public boolean canSetBoolean()
canSetBoolean
in interface Column
public boolean getBoolean(int row) throws DataTypeException
getBoolean
in interface Column
row
- the row from which to retrieve the value
DataTypeException
- if this column does not
support the boolean typepublic void setBoolean(boolean val, int row) throws DataTypeException
setBoolean
in interface Column
val
- the value to setrow
- the row at which to set the value
DataTypeException
- if this column does not
support the boolean typepublic boolean canGetString()
canGetString
in interface Column
public boolean canSetString()
canSetString
in interface Column
public java.lang.String getString(int row) throws DataTypeException
getString
in interface Column
row
- the row from which to retrieve the value
DataTypeException
- if this column does not
support the String typepublic void setString(java.lang.String val, int row) throws DataTypeException
setString
in interface Column
val
- the value to setrow
- the row at which to set the value
DataTypeException
- if this column does not
support the String typepublic boolean canGetDate()
canGetDate
in interface Column
public boolean canSetDate()
canSetDate
in interface Column
public java.util.Date getDate(int row) throws DataTypeException
getDate
in interface Column
row
- the row from which to retrieve the value
DataTypeException
- if this column does not
support the Date typepublic void setDate(java.util.Date val, int row) throws DataTypeException
setDate
in interface Column
val
- the value to setrow
- the row at which to set the value
DataTypeException
- if this column does not
support the Date type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |