prefuse.data.column
Interface Column

All Known Implementing Classes:
AbstractColumn, BooleanColumn, ByteColumn, ConstantColumn, DateColumn, DoubleColumn, ExpressionColumn, FloatColumn, IntColumn, LongColumn, ObjectColumn

public interface Column

Interface for a data column in a table.

Author:
jeffrey heer

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.
 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
 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.
 int getRowCount()
          Returns the number of rows in this data 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 set(java.lang.Object val, int row)
          Set the data value at the specified row
 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 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 setMaximumRow(int nrows)
          Sets the number of rows in this data column
 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
 

Method Detail

getRowCount

int getRowCount()
Returns the number of rows in this data column

Returns:
the number of rows

setMaximumRow

void setMaximumRow(int nrows)
Sets the number of rows in this data column

Parameters:
nrows - the number of rows

isReadOnly

boolean isReadOnly()
Indicates if the values in this column are read-only.

Returns:
true if the values can not be edited, false otherwise

setReadOnly

void setReadOnly(boolean readOnly)
Sets if the values in this column are read-only

Parameters:
readOnly - true to ensure the values can not be edited, false otherwise

isCellEditable

boolean isCellEditable(int row)
Indicates if the value at the given row can be edited.

Parameters:
row - the row to check
Returns:
true is the value can be modified, false otherwise

getColumnType

java.lang.Class getColumnType()
Returns the most specific superclass for the values in the column

Returns:
the Class of the column's data values

getParser

DataParser getParser()
Get the data parser used to map String values to and from the values stored by this Column.

Returns:
the DataParser used by this Column

setParser

void setParser(DataParser parser)
Set the data parser used to map String values to and from the values stored by this Column.

Parameters:
parser - the DataParser to use

addColumnListener

void addColumnListener(ColumnListener listener)
Adds a listener to be notified when this column changes

Parameters:
listener - the ColumnListener to add

removeColumnListener

void removeColumnListener(ColumnListener listener)
Removes a listener, causing it to no longer be notified of changes

Parameters:
listener - the ColumnListener to remove

getDefaultValue

java.lang.Object getDefaultValue()
Returns the default value for rows that have not been set explicitly.


revertToDefault

void revertToDefault(int row)
Reverts the specified row back to the column's default value.

Parameters:
row -

canGet

boolean canGet(java.lang.Class type)
Indicates if the get method can be called without an exception being thrown for the given type.

Parameters:
type - the Class of the data type to check
Returns:
true if the type is supported by this column, false otherwise

canSet

boolean canSet(java.lang.Class type)
Indicates if the set method can be called without an exception being thrown for the given type.

Parameters:
type - the Class of the data type to check
Returns:
true if the type is supported by this column, false otherwise

get

java.lang.Object get(int row)
Get the data value at the specified row

Parameters:
row - the row from which to retrieve the value
Returns:
the data value

set

void set(java.lang.Object val,
         int row)
         throws DataTypeException
Set the data value at the specified row

Parameters:
val - the value to set
row - the row at which to set the value
Throws:
DataTypeException

canGetInt

boolean canGetInt()
Indicates if convenience get method can be called without an exception being thrown for the int type.

Returns:
true if getInt is supported, false otherwise

canSetInt

boolean canSetInt()
Indicates if convenience set method can be called without an exception being thrown for the int type.

Returns:
true if setInt is supported, false otherwise

getInt

int getInt(int row)
           throws DataTypeException
Get the data value at the specified row as an integer

Parameters:
row - the row from which to retrieve the value
Returns:
the data value as an integer
Throws:
DataTypeException - if this column does not support the integer type

setInt

void setInt(int val,
            int row)
            throws DataTypeException
Set the data value at the specified row as an integer

Parameters:
val - the value to set
row - the row at which to set the value
Throws:
DataTypeException - if this column does not support the integer type

canGetLong

boolean canGetLong()
Indicates if convenience get method can be called without an exception being thrown for the long type.

Returns:
true if getLong is supported, false otherwise

canSetLong

boolean canSetLong()
Indicates if convenience set method can be called without an exception being thrown for the long type.

Returns:
true if setLong is supported, false otherwise

getLong

long getLong(int row)
             throws DataTypeException
Get the data value at the specified row as a long

Parameters:
row - the row from which to retrieve the value
Returns:
the data value as a long
Throws:
DataTypeException - if this column does not support the long type

setLong

void setLong(long val,
             int row)
             throws DataTypeException
Set the data value at the specified row as a long

Parameters:
val - the value to set
row - the row at which to set the value
Throws:
DataTypeException - if this column does not support the long type

canGetFloat

boolean canGetFloat()
Indicates if convenience get method can be called without an exception being thrown for the float type.

Returns:
true if getFloat is supported, false otherwise

canSetFloat

boolean canSetFloat()
Indicates if convenience set method can be called without an exception being thrown for the float type.

Returns:
true if setFloat is supported, false otherwise

getFloat

float getFloat(int row)
               throws DataTypeException
Get the data value at the specified row as a float

Parameters:
row - the row from which to retrieve the value
Returns:
the data value as a float
Throws:
DataTypeException - if this column does not support the float type

setFloat

void setFloat(float val,
              int row)
              throws DataTypeException
Set the data value at the specified row as a float

Parameters:
val - the value to set
row - the row at which to set the value
Throws:
DataTypeException - if this column does not support the float type

canGetDouble

boolean canGetDouble()
Indicates if convenience get method can be called without an exception being thrown for the double type.

Returns:
true if getDouble is supported, false otherwise

canSetDouble

boolean canSetDouble()
Indicates if convenience set method can be called without an exception being thrown for the double type.

Returns:
true if setDouble is supported, false otherwise

getDouble

double getDouble(int row)
                 throws DataTypeException
Get the data value at the specified row as a double

Parameters:
row - the row from which to retrieve the value
Returns:
the data value as a double
Throws:
DataTypeException - if this column does not support the double type

setDouble

void setDouble(double val,
               int row)
               throws DataTypeException
Set the data value at the specified row as a double

Parameters:
val - the value to set
row - the row at which to set the value
Throws:
DataTypeException - if this column does not support the double type

canGetBoolean

boolean canGetBoolean()
Indicates if convenience get method can be called without an exception being thrown for the boolean type.

Returns:
true if getBoolean is supported, false otherwise

canSetBoolean

boolean canSetBoolean()
Indicates if convenience set method can be called without an exception being thrown for the boolean type.

Returns:
true if setBoolean is supported, false otherwise

getBoolean

boolean getBoolean(int row)
                   throws DataTypeException
Get the data value at the specified row as a boolean

Parameters:
row - the row from which to retrieve the value
Returns:
the data value as a boolean
Throws:
DataTypeException - if this column does not support the boolean type

setBoolean

void setBoolean(boolean val,
                int row)
                throws DataTypeException
Set the data value at the specified row as a boolean

Parameters:
val - the value to set
row - the row at which to set the value
Throws:
DataTypeException - if this column does not support the boolean type

canGetString

boolean canGetString()
Indicates if convenience get method can be called without an exception being thrown for the String type.

Returns:
true if getString is supported, false otherwise

canSetString

boolean canSetString()
Indicates if convenience set method can be called without an exception being thrown for the String type.

Returns:
true if setString is supported, false otherwise

getString

java.lang.String getString(int row)
                           throws DataTypeException
Get the data value at the specified row as a String

Parameters:
row - the row from which to retrieve the value
Returns:
the data value as a String
Throws:
DataTypeException - if this column does not support the String type

setString

void setString(java.lang.String val,
               int row)
               throws DataTypeException
Set the data value at the specified row as a String

Parameters:
val - the value to set
row - the row at which to set the value
Throws:
DataTypeException - if this column does not support the String type

canGetDate

boolean canGetDate()
Indicates if convenience get method can be called without an exception being thrown for the Date type.

Returns:
true if getDate is supported, false otherwise

canSetDate

boolean canSetDate()
Indicates if convenience set method can be called without an exception being thrown for the Date type.

Returns:
true if setDate is supported, false otherwise

getDate

java.util.Date getDate(int row)
                       throws DataTypeException
Get the data value at the specified row as a Date

Parameters:
row - the row from which to retrieve the value
Returns:
the data value as a Date
Throws:
DataTypeException - if this column does not support the Date type

setDate

void setDate(java.util.Date val,
             int row)
             throws DataTypeException
Set the data value at the specified row as a Date

Parameters:
val - the value to set
row - the row at which to set the value
Throws:
DataTypeException - if this column does not support the Date type


Copyright © 2007 Regents of the University of California