infovis.tree
Class TreeIntColumn

java.lang.Object
  extended by infovis.utils.ChangeManager
      extended by infovis.column.AbstractColumn
          extended by infovis.column.BasicColumn
              extended by infovis.column.LiteralColumn
                  extended by infovis.column.IntColumn
                      extended by infovis.tree.TreeIntColumn
All Implemented Interfaces:
IntComparator, Column, NumberColumn, Metadata, Constants, RowComparator, Serializable, EventListener, TreeModelListener
Direct Known Subclasses:
DegreeColumn, DepthColumn, LeafCountColumn, RainbowColumn

public abstract class TreeIntColumn
extends IntColumn
implements TreeModelListener

Base class for columns computing topological values on a tree.

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
TreeIntColumn(String name, Tree tree)
          Constructor.
 
Method Summary
 void dispose()
          Releases listeners.
 int get(int index)
          Returns the element at the specified position in this column.
 IntArrayList getValueReference()
          Returns the DoubleArrayList backing the implementation of the column (USE WITH CARE).
 void invalidate()
          Sets the column to invalid.
 boolean isInvalid()
           
 RowIterator iterator()
          Returns a RowIterator over all the valid rows of this column.
 int size()
          Returns the number of elements in this column.
 void sort(RowComparator comp)
          Sort the values of this column according to a comparator.
 void stableSort(RowComparator comp)
          Sort the values of this column according to a comparator using a stable sort algorithm.
 int[] toArray()
          Returns the array of integer values used by the column.
 int[] toArray(int[] a)
          Returns the array of integer values copied from the column.
 void treeNodesChanged(TreeModelEvent e)
          
 void treeNodesInserted(TreeModelEvent e)
          
 void treeNodesRemoved(TreeModelEvent e)
          
 void treeStructureChanged(TreeModelEvent e)
          
 void validate()
          Validate the contents of this column if needed.
 
Methods inherited from class infovis.column.IntColumn
add, addExtend, capacity, clear, ensureCapacity, fill, findColumn, format, format, getColumn, getColumn, getDoubleAt, getFloatAt, getIntAt, getLongAt, getMax, getMin, getValueAt, getValueClass, parse, round, set, setDoubleAt, setExtend, setIntAt, setLongAt, setSize, setValueAt
 
Methods inherited from class infovis.column.LiteralColumn
compare, compareValues, getDoubleMax, getDoubleMin, getNumberColumn, hasUndefinedValue, isValueUndefined, setFloatAt, setValueUndefined, trimUndefined
 
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
disableNotify, enableNotify, getModCount, removeChangeListener
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface infovis.Column
addChangeListener, addValue, addValueOrNull, disableNotify, enableNotify, getFormat, getMaxIndex, getMinIndex, getName, isEmpty, isInternal, removeChangeListener, setFormat, setName, setValueOrNullAt
 
Methods inherited from interface infovis.Metadata
getClientProperty, getMetadata
 
Methods inherited from interface cern.colt.function.IntComparator
equals
 

Constructor Detail

TreeIntColumn

public TreeIntColumn(String name,
                     Tree tree)
Constructor.

Parameters:
name - column name
tree - associated tree
Method Detail

dispose

public void dispose()
Releases listeners.


get

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

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

size

public int size()
Returns the number of elements in this column.

Specified by:
size in interface Column
Overrides:
size in class IntColumn
Returns:
the number of elements in this column.

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 BasicColumn
Returns:
a RowIterator over all the valid rows of this column.

toArray

public int[] toArray()
Returns the array of integer values used by the column. BEWARE! no copy is done for performance reasons and the array should only be read. It may become out of sync with the column if the column is resized.

Overrides:
toArray in class IntColumn
Returns:
the array of integer values used by the column.

toArray

public int[] toArray(int[] a)
Returns the array of integer values copied from the column.

Overrides:
toArray in class IntColumn
Parameters:
a - an array of int with at least the column size or null.
Returns:
the array of integer values copied from the column.

sort

public void sort(RowComparator comp)
Sort the values of this column according to a comparator.

Overrides:
sort in class IntColumn
Parameters:
comp - the comparator

stableSort

public void stableSort(RowComparator comp)
Sort the values of this column according to a comparator using a stable sort algorithm.

Overrides:
stableSort in class IntColumn
Parameters:
comp - the comparator

getValueReference

public IntArrayList getValueReference()
Returns the DoubleArrayList backing the implementation of the column (USE WITH CARE).

Overrides:
getValueReference in class IntColumn
Returns:
the DoubleArrayList backing the implementation of the column.

validate

public void validate()
Validate the contents of this column if needed.


invalidate

public void invalidate()
Sets the column to invalid.


isInvalid

public boolean isInvalid()
Returns:
Returns the invalid.

treeNodesChanged

public void treeNodesChanged(TreeModelEvent e)

Specified by:
treeNodesChanged in interface TreeModelListener

treeNodesInserted

public void treeNodesInserted(TreeModelEvent e)

Specified by:
treeNodesInserted in interface TreeModelListener

treeNodesRemoved

public void treeNodesRemoved(TreeModelEvent e)

Specified by:
treeNodesRemoved in interface TreeModelListener

treeStructureChanged

public void treeStructureChanged(TreeModelEvent e)

Specified by:
treeStructureChanged in interface TreeModelListener


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