infovis.table
Class DefaultDynamicTable

java.lang.Object
  extended by infovis.utils.ChangeManager
      extended by infovis.column.AbstractColumn
          extended by infovis.column.BasicColumn
              extended by infovis.column.BasicObjectColumn
                  extended by infovis.column.ColumnColumn
                      extended by infovis.table.DefaultTable
                          extended by infovis.table.DefaultDynamicTable
All Implemented Interfaces:
IntComparator, Column, DynamicTable, Metadata, Constants, Table, RowComparator, Serializable, EventListener, ChangeListener, TableModel
Direct Known Subclasses:
DefaultTree

public class DefaultDynamicTable
extends DefaultTable
implements DynamicTable

Default implementatio for dynamic tables.

Version:
$Revision: 1.9 $
Author:
Jean-Daniel Fekete
See Also:
Serialized Form

Field Summary
 
Fields inherited from class infovis.column.AbstractColumn
MODIFIED_ALL, MODIFIED_NONE
 
Fields inherited from interface infovis.Table
FILTER_COLUMN, INTERNAL_PREFIX, NIL, SELECTION_COLUMN
 
Fields inherited from interface infovis.metadata.Constants
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE
 
Constructor Summary
DefaultDynamicTable()
          Constructor.
DefaultDynamicTable(int size)
          Constructor with a given allocated rowCount.
 
Method Summary
 int addRow()
          Creates a new row and returns it.
 void clear()
          Removes all of the elements from this column. The Column will be empty after this call returns. WARNING: if there is an associated format that maintains a status, such as a CategoricalFormat, it is not cleared so results may not be what you expected. The CategoricalFormat can be cleared explicitely if needed.
 int getLastRow()
          Returns the index of the last row in the table.
 int getRowCount()
          Returns the number of rows in the table.
 boolean isRowValid(int row)
          Checks whether a specified row is valid.
 RowIterator iterator()
          Returns a RowIterator over all the valid rows of this column.
 void removeRow(int row)
          Removes a specified row.
 RowIterator reverseIterator()
          Returns an iterator over the columns of this table in reverse order.
 
Methods inherited from class infovis.table.DefaultTable
addColumn, addTableModelListener, disableNotify, enableNotify, fireTableChanged, fireTableDataChanged, fireTableDataChanged, fireTableStructureChanged, getColumn, getColumnAt, getColumnClass, getColumnCount, getColumnName, getObjectFromRow, getRowFromObject, getTable, getValueAt, hasTableModelListener, indexOf, indexOf, isCellEditable, isColumnInternal, removeColumn, removeTableModelListener, setColumnAt, setValueAt, stateChanged
 
Methods inherited from class infovis.column.ColumnColumn
add, compare, compare, definedValue, fill, findColumn, get, getColumn, getColumn, getValueClass, set, setExtend
 
Methods inherited from class infovis.column.BasicObjectColumn
add, capacity, compare, compareValues, ensureCapacity, fill, format, getObjectAt, getOrder, getValueAt, getValueReference, hasUndefinedValue, indexOf, isValueUndefined, parse, remove, remove, setExtend, setObjectAt, setOrder, setSize, setValueAt, setValueUndefined, size
 
Methods inherited from class infovis.column.BasicColumn
addValue, addValueOrNull, firstValidRow, getClientProperty, getFormat, getMaxIndex, getMetadata, getMinIndex, getName, isEmpty, isInternal, lastValidRow, setFormat, setName, setValueOrNullAt, toString
 
Methods inherited from class infovis.column.AbstractColumn
addChangeListener, computeValueMap, computeValueMap, equalObj, equals, getLastModifiedRow
 
Methods inherited from class infovis.utils.ChangeManager
getModCount, removeChangeListener
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface infovis.Table
addColumn, getColumn, getColumnAt, getColumnCount, getTable, indexOf, indexOf, removeColumn, setColumnAt
 
Methods inherited from interface infovis.Column
addChangeListener, addValue, addValueOrNull, capacity, disableNotify, enableNotify, ensureCapacity, getFormat, getMaxIndex, getMinIndex, getName, getValueAt, getValueClass, hasUndefinedValue, isEmpty, isInternal, isValueUndefined, removeChangeListener, setFormat, setName, setSize, setValueAt, setValueOrNullAt, setValueUndefined, size
 
Methods inherited from interface infovis.Metadata
getClientProperty, getMetadata
 
Methods inherited from interface cern.colt.function.IntComparator
compare, equals
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnName, getValueAt, isCellEditable, removeTableModelListener, setValueAt
 

Constructor Detail

DefaultDynamicTable

public DefaultDynamicTable()
Constructor.


DefaultDynamicTable

public DefaultDynamicTable(int size)
Constructor with a given allocated rowCount.

Parameters:
size - the number of rows already allocated.
Method Detail

clear

public void clear()
Removes all of the elements from this column. The Column will be empty after this call returns. WARNING: if there is an associated format that maintains a status, such as a CategoricalFormat, it is not cleared so results may not be what you expected. The CategoricalFormat can be cleared explicitely if needed.

Specified by:
clear in interface Column
Specified by:
clear in interface Table
Overrides:
clear in class DefaultTable

getRowCount

public int getRowCount()
Returns the number of rows in the table.

Specified by:
getRowCount in interface Table
Specified by:
getRowCount in interface TableModel
Overrides:
getRowCount in class DefaultTable
Returns:
the number of rows in the table.

getLastRow

public int getLastRow()
Returns the index of the last row in the table.

Specified by:
getLastRow in interface Table
Overrides:
getLastRow in class DefaultTable
Returns:
the index of the last row in the table

iterator

public RowIterator iterator()
Returns a RowIterator over all the valid rows of this column.

Specified by:
iterator in interface Column
Overrides:
iterator in class DefaultTable
Returns:
a RowIterator over all the valid rows of this column.

reverseIterator

public RowIterator reverseIterator()
Returns an iterator over the columns of this table in reverse order.

Specified by:
reverseIterator in interface Table
Overrides:
reverseIterator in class DefaultTable
Returns:
an iterator over the columns of this table in reverse order.

isRowValid

public boolean isRowValid(int row)
Checks whether a specified row is valid.

Specified by:
isRowValid in interface Table
Overrides:
isRowValid in class DefaultTable
Parameters:
row - the row.
Returns:
true if it is.

addRow

public int addRow()
Creates a new row and returns it.

Specified by:
addRow in interface DynamicTable
Returns:
the new created row.

removeRow

public void removeRow(int row)
Removes a specified row.

Specified by:
removeRow in interface DynamicTable
Parameters:
row - the row to remove.


Copyright © 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.