infovis.column
Class ColumnColumn

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
All Implemented Interfaces:
IntComparator, Column, Metadata, Constants, RowComparator, Serializable
Direct Known Subclasses:
DefaultTable

public class ColumnColumn
extends BasicObjectColumn

Column containing columns.

Version:
$Revision: 1.4 $
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.metadata.Constants
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE
 
Constructor Summary
ColumnColumn(String name)
          Creates a new ColumnColumn object.
ColumnColumn(String name, int reserve)
          Creates a new ColumnColumn object.
 
Method Summary
 void add(Column element)
          Adds an element to the column.
 int compare(Column c1, Column c2)
          Comparator for elements of this column.
 int compare(int row1, int row2)
          
 Object definedValue()
          Returns the instance of a value defined with the right type for this column.
 void fill(Column val)
          Fills the column with the specified value.
static ColumnColumn findColumn(Table t, String name)
          Returns a column as a ColumnColumn from a table, creating it if needed.
 Column get(int index)
          Returns the element at the specified position in this column.
static ColumnColumn getColumn(Table t, int index)
          Returns a column as a ColumnColumn from an Table.
static ColumnColumn getColumn(Table t, String name)
          Returns a column as a ColumnColumn from a Table.
 Class getValueClass()
          Returns the class of the elements.
 void set(int index, Column element)
          Replaces the element at the specified position in this column with the specified element.
 void setExtend(int index, Column element)
          Replaces the element at the specified position in this column with the specified element, growing the column if necessary.
 
Methods inherited from class infovis.column.BasicObjectColumn
add, capacity, clear, 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, iterator, 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
disableNotify, enableNotify, getModCount, removeChangeListener
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface infovis.Column
disableNotify, enableNotify, removeChangeListener
 

Constructor Detail

ColumnColumn

public ColumnColumn(String name)
Creates a new ColumnColumn object.

Parameters:
name - the column name.

ColumnColumn

public ColumnColumn(String name,
                    int reserve)
Creates a new ColumnColumn object.

Parameters:
name - the column name.
reserve - the initial capacity.
Method Detail

get

public Column get(int index)
Returns the element at the specified position in this column.

Parameters:
index - index of element to return.
Returns:
the element at the specified position in this column.

set

public void set(int index,
                Column element)
Replaces the element at the specified position in this column with the specified element.

Parameters:
index - index of element to replace.
element - element to be stored at the specified position.

setExtend

public void setExtend(int index,
                      Column element)
Replaces the element at the specified position in this column with the specified element, growing the column if necessary.

Parameters:
index - index of element to replace.
element - element to be stored at the specified position.

add

public void add(Column element)
Adds an element to the column.

Parameters:
element - the element.

fill

public void fill(Column val)
Fills the column with the specified value.

Parameters:
val - the value

compare

public final int compare(Column c1,
                         Column c2)
Comparator for elements of this column.

Parameters:
c1 - first element.
c2 - second element.
Returns:
the comparison of the elements.

getColumn

public static ColumnColumn getColumn(Table t,
                                     int index)
Returns a column as a ColumnColumn from an Table.

Parameters:
t - the Table
index - index in the Table
Returns:
a ColumnColumn or null if no such column exists or the column is not a ColumnColumn.

getColumn

public static ColumnColumn getColumn(Table t,
                                     String name)
Returns a column as a ColumnColumn from a Table.

Parameters:
t - the Table
name - the column name.
Returns:
a ColumnColumn or null if no such column exists or the column is not a ColumnColumn.

findColumn

public static ColumnColumn findColumn(Table t,
                                      String name)
Returns a column as a ColumnColumn from a table, creating it if needed.

Parameters:
t - the Table
name - the column name.
Returns:
a column as a ColumnColumn from a table,

getValueClass

public Class getValueClass()
Returns the class of the elements.

Specified by:
getValueClass in interface Column
Overrides:
getValueClass in class BasicObjectColumn
Returns:
the class of the elements.

compare

public int compare(int row1,
                   int row2)

Specified by:
compare in interface IntComparator
Overrides:
compare in class BasicObjectColumn

definedValue

public Object definedValue()
Returns the instance of a value defined with the right type for this column.

Specified by:
definedValue in class BasicObjectColumn
Returns:
the instance of a value defined with the right type for this column.


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