prefuse.data.column
Class ObjectColumn

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

public class ObjectColumn
extends AbstractColumn

Column implementation for storing arbitrary Object values.

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
ObjectColumn()
          Create a new empty ObjectColumn.
ObjectColumn(java.lang.Class type)
          Create a new ObjectColumn.
ObjectColumn(java.lang.Class type, int nrows)
          Create a new ObjectColumn.
ObjectColumn(java.lang.Class type, int nrows, int capacity, java.lang.Object defaultValue)
          Create a new ObjectColumn.
ObjectColumn(int nrows)
          Create a new ObjectColumn.
 
Method Summary
 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 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 setMaximumRow(int nrows)
          Sets the number of rows in this data column
 
Methods inherited from class prefuse.data.column.AbstractColumn
addColumnListener, canGet, canGetBoolean, canGetDate, canGetDouble, canGetFloat, canGetInt, canGetLong, canGetString, canSet, 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, removeColumnListener, 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

ObjectColumn

public ObjectColumn()
Create a new empty ObjectColumn. The type is assumed to be Object.


ObjectColumn

public ObjectColumn(java.lang.Class type)
Create a new ObjectColumn.

Parameters:
type - the data type of Objects in this column

ObjectColumn

public ObjectColumn(int nrows)
Create a new ObjectColumn. The type is assumed to be Object.

Parameters:
nrows - the initial size of the column

ObjectColumn

public ObjectColumn(java.lang.Class type,
                    int nrows)
Create a new ObjectColumn.

Parameters:
type - the data type of Objects in this column
nrows - the initial size of the column

ObjectColumn

public ObjectColumn(java.lang.Class type,
                    int nrows,
                    int capacity,
                    java.lang.Object defaultValue)
Create a new ObjectColumn.

Parameters:
type - the data type of Objects in this column
nrows - the initial size of the column
capacity - the initial capacity of the column
defaultValue - the default value for the column. If this value is cloneable, it will be cloned when assigned as defaultValue, otherwise the input reference will be used for every default value.
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)

revertToDefault

public void revertToDefault(int row)
Description copied from class: AbstractColumn
Reverts the specified row back to the column's default value.

Specified by:
revertToDefault in interface Column
Overrides:
revertToDefault in class AbstractColumn

get

public 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

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

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


Copyright © 2007 Regents of the University of California