prefuse.data.column
Class ConstantColumn

java.lang.Object
  extended by prefuse.data.column.AbstractColumn
      extended by prefuse.data.column.ConstantColumn
All Implemented Interfaces:
Column

public class ConstantColumn
extends AbstractColumn

Column implementation holding a single, constant value for all rows.

Author:
jeffrey heer

Field Summary
 
Fields inherited from class prefuse.data.column.AbstractColumn
m_columnType, m_defaultValue, m_listeners, m_parser, m_readOnly
 
Constructor Summary
ConstantColumn(java.lang.Class type, java.lang.Object defaultValue)
          Create a new ConstantColumn.
 
Method Summary
 void addColumnListener(ColumnListener listener)
          Does nothing.
 boolean canSet(java.lang.Class type)
          Returns false.
 java.lang.Object get(int row)
          Get the data value at the specified row
 int getRowCount()
          Returns the number of rows in this data column
 void removeColumnListener(ColumnListener listener)
          Does nothing.
 void set(java.lang.Object val, int row)
          Unsupported operation.
 void setMaximumRow(int nrows)
          Sets the number of rows in this data column
 
Methods inherited from class prefuse.data.column.AbstractColumn
canGet, canGetBoolean, canGetDate, canGetDouble, canGetFloat, canGetInt, canGetLong, canGetString, canSetBoolean, canSetDate, canSetDouble, canSetFloat, canSetInt, canSetLong, canSetString, fireColumnEvent, fireColumnEvent, fireColumnEvent, fireColumnEvent, fireColumnEvent, fireColumnEvent, fireColumnEvent, getBoolean, getColumnType, getDate, getDefaultValue, getDouble, getFloat, getInt, getLong, getParser, getString, isCellEditable, isReadOnly, revertToDefault, 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

ConstantColumn

public ConstantColumn(java.lang.Class type,
                      java.lang.Object defaultValue)
Create a new ConstantColumn.

Parameters:
type - the data type of this column
defaultValue - the default value used for all rows
Method Detail

getRowCount

public int getRowCount()
Description copied from interface: Column
Returns the number of rows in this data column

Returns:
the number of rows
See Also:
Column.getRowCount()

setMaximumRow

public void setMaximumRow(int nrows)
Description copied from interface: Column
Sets the number of rows in this data column

Parameters:
nrows - the number of rows
See Also:
Column.setMaximumRow(int)

get

public java.lang.Object get(int row)
Description copied from interface: Column
Get the data value at the specified row

Parameters:
row - the row from which to retrieve the value
Returns:
the data value
See Also:
Column.get(int)

set

public void set(java.lang.Object val,
                int row)
         throws DataTypeException
Unsupported operation.

Parameters:
val - the value to set
row - the row at which to set the value
Throws:
DataTypeException
See Also:
Column.set(java.lang.Object, int)

canSet

public boolean canSet(java.lang.Class type)
Returns false.

Specified by:
canSet in interface Column
Overrides:
canSet in class AbstractColumn
Parameters:
type - the Class of the data type to check
Returns:
true if the type is supported by this column, false otherwise
See Also:
Column.canSet(java.lang.Class)

addColumnListener

public void addColumnListener(ColumnListener listener)
Does nothing.

Specified by:
addColumnListener in interface Column
Overrides:
addColumnListener in class AbstractColumn
Parameters:
listener - the ColumnListener to add
See Also:
Column.addColumnListener(prefuse.data.event.ColumnListener)

removeColumnListener

public void removeColumnListener(ColumnListener listener)
Does nothing.

Specified by:
removeColumnListener in interface Column
Overrides:
removeColumnListener in class AbstractColumn
Parameters:
listener - the ColumnListener to remove
See Also:
Column.removeColumnListener(prefuse.data.event.ColumnListener)


Copyright © 2007 Regents of the University of California