|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectprefuse.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 column
public AbstractColumn(java.lang.Class columnType,
java.lang.Object defaultValue)
columnType - the data type stored by this columndefaultValue - the default data value to use| Method Detail |
|---|
public 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 check
public java.lang.Class getColumnType()
getColumnType in interface Columnpublic DataParser getParser()
Column
getParser in interface ColumnColumn.getParser()public void setParser(DataParser parser)
Column
setParser 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 remove
protected 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 index
protected final void fireColumnEvent(int idx,
long prev)
idx - the row index of the column that was updatedprev - the previous value at the given index
protected final void fireColumnEvent(int idx,
float prev)
idx - the row index of the column that was updatedprev - the previous value at the given index
protected final void fireColumnEvent(int idx,
double prev)
idx - the row index of the column that was updatedprev - the previous value at the given index
protected final void fireColumnEvent(int idx,
boolean prev)
idx - the row index of the column that was updatedprev - the previous value at the given index
protected 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)
canGet in interface Columntype - the Class of the data type to check
public boolean canSet(java.lang.Class type)
canSet in interface Columntype - the Class of the data type to check
public boolean canGetInt()
canGetInt in interface Columnpublic boolean canSetInt()
canSetInt in interface Column
public int getInt(int row)
throws DataTypeException
getInt in interface Columnrow - the row from which to retrieve the value
DataTypeException - if this column does not
support the integer type
public void setInt(int val,
int row)
throws DataTypeException
setInt in interface Columnval - 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 Columnpublic boolean canSetLong()
canSetLong in interface Column
public long getLong(int row)
throws DataTypeException
getLong in interface Columnrow - the row from which to retrieve the value
DataTypeException - if this column does not
support the long type
public void setLong(long val,
int row)
throws DataTypeException
setLong in interface Columnval - 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 Columnpublic boolean canSetFloat()
canSetFloat in interface Column
public float getFloat(int row)
throws DataTypeException
getFloat in interface Columnrow - the row from which to retrieve the value
DataTypeException - if this column does not
support the float type
public void setFloat(float val,
int row)
throws DataTypeException
setFloat in interface Columnval - 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 Columnpublic boolean canSetDouble()
canSetDouble in interface Column
public double getDouble(int row)
throws DataTypeException
getDouble in interface Columnrow - the row from which to retrieve the value
DataTypeException - if this column does not
support the double type
public void setDouble(double val,
int row)
throws DataTypeException
setDouble in interface Columnval - 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 Columnpublic boolean canSetBoolean()
canSetBoolean in interface Column
public boolean getBoolean(int row)
throws DataTypeException
getBoolean in interface Columnrow - the row from which to retrieve the value
DataTypeException - if this column does not
support the boolean type
public void setBoolean(boolean val,
int row)
throws DataTypeException
setBoolean in interface Columnval - 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 Columnpublic boolean canSetString()
canSetString in interface Column
public java.lang.String getString(int row)
throws DataTypeException
getString in interface Columnrow - the row from which to retrieve the value
DataTypeException - if this column does not
support the String type
public 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 value
DataTypeException - if this column does not
support the String typepublic boolean canGetDate()
canGetDate in interface Columnpublic boolean canSetDate()
canSetDate in interface Column
public java.util.Date getDate(int row)
throws DataTypeException
getDate in interface Columnrow - the row from which to retrieve the value
DataTypeException - if this column does not
support the Date type
public 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 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 | |||||||||