infovis.column
Class ColumnId

java.lang.Object
  extended by infovis.utils.ChangeManager
      extended by infovis.column.AbstractColumn
          extended by infovis.column.ColumnProxy
              extended by infovis.column.ColumnId
All Implemented Interfaces:
IntComparator, Column, NumberColumn, Metadata, Constants, RowComparator, Serializable, EventListener, ChangeListener

public class ColumnId
extends ColumnProxy
implements NumberColumn

Class ColumnId wraps any column to make it a NumberColumn. As value, it simply returns the index of the element.

Version:
$Revision: 1.7 $
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
 
Method Summary
static ColumnId findIdColumn(Column col)
          Search for an IdColumn associated with a specified column and returns it or creates it if none exists.
 String format(double value)
          Returns the specified value formatted according to this column's format.
 int get(int row)
          Returns the row.
 double getDoubleAt(int row)
          Returns the value as a double.
 double getDoubleMax()
          Returns the largset value as a double.
 double getDoubleMin()
          Returns the smallest value as a double.
 float getFloatAt(int row)
          Returns the value as a float.
 int getIntAt(int row)
          Returns the value as an int.
 long getLongAt(int row)
          Returns the value as a long.
 double round(double value)
          Returns the rounded value according to the semantics of this number value.
 void setDoubleAt(int row, double v)
          Sets the value as a double.
 void setFloatAt(int row, float v)
          Sets the value as a float.
 void setIntAt(int row, int v)
          Sets the value as an int.
 void setLongAt(int row, long v)
          Sets the value as a long.
 
Methods inherited from class infovis.column.ColumnProxy
addValue, addValueOrNull, capacity, clear, compare, dispose, ensureCapacity, getClientProperty, getFormat, getMaxIndex, getMetadata, getMinIndex, getName, getValueAt, getValueClass, hasUndefinedValue, isEmpty, isInternal, isValueUndefined, iterator, setFormat, setName, setSize, setValueAt, setValueOrNullAt, setValueUndefined, size, stateChanged
 
Methods inherited from class infovis.column.AbstractColumn
addChangeListener, compareValues, computeValueMap, computeValueMap, equalObj, equals, getLastModifiedRow, toString
 
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, capacity, clear, disableNotify, enableNotify, ensureCapacity, getFormat, getMaxIndex, getMinIndex, getName, getValueAt, getValueClass, hasUndefinedValue, isEmpty, isInternal, isValueUndefined, iterator, 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
 

Method Detail

findIdColumn

public static ColumnId findIdColumn(Column col)
Search for an IdColumn associated with a specified column and returns it or creates it if none exists.

Parameters:
col - the column
Returns:
an IdColumn associated with the specified column

get

public int get(int row)
Returns the row.

Parameters:
row - the row
Returns:
the row

getDoubleAt

public double getDoubleAt(int row)
Returns the value as a double.

Specified by:
getDoubleAt in interface NumberColumn
Parameters:
row - the row
Returns:
the value as a double

getDoubleMax

public double getDoubleMax()
Returns the largset value as a double.

Specified by:
getDoubleMax in interface NumberColumn
Returns:
the largset value as a double.

getDoubleMin

public double getDoubleMin()
Returns the smallest value as a double.

Specified by:
getDoubleMin in interface NumberColumn
Returns:
the smallest value as a double.

getFloatAt

public float getFloatAt(int row)
Returns the value as a float.

Specified by:
getFloatAt in interface NumberColumn
Parameters:
row - the row
Returns:
the value as a float

getIntAt

public int getIntAt(int row)
Returns the value as an int.

Specified by:
getIntAt in interface NumberColumn
Parameters:
row - the row
Returns:
the value as an int

getLongAt

public long getLongAt(int row)
Returns the value as a long.

Specified by:
getLongAt in interface NumberColumn
Parameters:
row - the row
Returns:
the value as a long

round

public double round(double value)
Returns the rounded value according to the semantics of this number value.

Specified by:
round in interface NumberColumn
Parameters:
value - the value to round
Returns:
the rounded value according to the semantics of this number value.

setDoubleAt

public void setDoubleAt(int row,
                        double v)
Sets the value as a double.

Specified by:
setDoubleAt in interface NumberColumn
Parameters:
row - the row
v - the value as a double

setFloatAt

public void setFloatAt(int row,
                       float v)
Sets the value as a float.

Specified by:
setFloatAt in interface NumberColumn
Parameters:
row - the row
v - the value as a float

setIntAt

public void setIntAt(int row,
                     int v)
Sets the value as an int.

Specified by:
setIntAt in interface NumberColumn
Parameters:
row - the row
v - the value as an int

setLongAt

public void setLongAt(int row,
                      long v)
Sets the value as a long.

Specified by:
setLongAt in interface NumberColumn
Parameters:
row - the row
v - the value as a long

format

public String format(double value)
Returns the specified value formatted according to this column's format.

Specified by:
format in interface NumberColumn
Parameters:
value - the value to format
Returns:
the string formatted according to this column's format.


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