public abstract class AbstractColumn extends java.lang.Object implements Column
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitget, getRowCount, set, setMaximumRowprotected final java.lang.Class m_columnType
protected DataParser m_parser
protected java.lang.Object m_defaultValue
protected boolean m_readOnly
protected CopyOnWriteArrayList m_listeners
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 usepublic boolean isReadOnly()
isReadOnly in interface Columnpublic void setReadOnly(boolean readOnly)
setReadOnly in interface ColumnreadOnly - true to ensure the values can not be edited,
false otherwisepublic boolean isCellEditable(int row)
isCellEditable in interface Columnrow - the row to checkpublic java.lang.Class getColumnType()
getColumnType in interface Columnpublic DataParser getParser()
ColumngetParser in interface ColumnColumn.getParser()public void setParser(DataParser parser)
ColumnsetParser in interface Columnparser - the DataParser to useColumn.setParser(prefuse.data.parser.DataParser)public void addColumnListener(ColumnListener listener)
addColumnListener in interface Columnlistener - the ColumnListener to addpublic void removeColumnListener(ColumnListener listener)
removeColumnListener in interface Columnlistener - 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 Columnpublic void setDefaultValue(java.lang.Object dFlt)
dFlt - public void revertToDefault(int row)
revertToDefault in interface Columnrow - public boolean canGet(java.lang.Class type)
public boolean canSet(java.lang.Class type)
public boolean canGetInt()
public boolean canSetInt()
public int getInt(int row)
throws DataTypeException
getInt in interface Columnrow - the row from which to retrieve the valueDataTypeException - if this column does not
support the integer typepublic void setInt(int val,
int row)
throws DataTypeException
setInt in interface Columnval - the value to setrow - the row at which to set the valueDataTypeException - if this column does not
support the integer typepublic boolean canGetLong()
canGetLong in interface Columnpublic boolean canSetLong()
canSetLong in interface Columnpublic long getLong(int row)
throws DataTypeException
getLong in interface Columnrow - the row from which to retrieve the valueDataTypeException - if this column does not
support the long typepublic void setLong(long val,
int row)
throws DataTypeException
setLong in interface Columnval - the value to setrow - the row at which to set the valueDataTypeException - if this column does not
support the long typepublic boolean canGetFloat()
canGetFloat in interface Columnpublic boolean canSetFloat()
canSetFloat in interface Columnpublic float getFloat(int row)
throws DataTypeException
getFloat in interface Columnrow - the row from which to retrieve the valueDataTypeException - if this column does not
support the float typepublic void setFloat(float val,
int row)
throws DataTypeException
setFloat in interface Columnval - the value to setrow - the row at which to set the valueDataTypeException - if this column does not
support the float typepublic boolean canGetDouble()
canGetDouble in interface Columnpublic boolean canSetDouble()
canSetDouble in interface Columnpublic double getDouble(int row)
throws DataTypeException
getDouble in interface Columnrow - the row from which to retrieve the valueDataTypeException - if this column does not
support the double typepublic void setDouble(double val,
int row)
throws DataTypeException
setDouble in interface Columnval - the value to setrow - the row at which to set the valueDataTypeException - if this column does not
support the double typepublic boolean canGetBoolean()
canGetBoolean in interface Columnpublic boolean canSetBoolean()
canSetBoolean in interface Columnpublic boolean getBoolean(int row)
throws DataTypeException
getBoolean in interface Columnrow - the row from which to retrieve the valueDataTypeException - if this column does not
support the boolean typepublic void setBoolean(boolean val,
int row)
throws DataTypeException
setBoolean in interface Columnval - the value to setrow - the row at which to set the valueDataTypeException - if this column does not
support the boolean typepublic boolean canGetString()
canGetString in interface Columnpublic boolean canSetString()
canSetString in interface Columnpublic java.lang.String getString(int row)
throws DataTypeException
getString in interface Columnrow - the row from which to retrieve the valueDataTypeException - if this column does not
support the String typepublic void setString(java.lang.String val,
int row)
throws DataTypeException
setString in interface Columnval - the value to setrow - the row at which to set the valueDataTypeException - if this column does not
support the String typepublic boolean canGetDate()
canGetDate in interface Columnpublic boolean canSetDate()
canSetDate in interface Columnpublic java.util.Date getDate(int row)
throws DataTypeException
getDate in interface Columnrow - the row from which to retrieve the valueDataTypeException - if this column does not
support the Date typepublic void setDate(java.util.Date val,
int row)
throws DataTypeException
setDate in interface Columnval - the value to setrow - the row at which to set the valueDataTypeException - if this column does not
support the Date type