infovis.column
Class IdColumn

java.lang.Object
  extended by infovis.column.ConstantColumn
      extended by infovis.column.IdColumn
All Implemented Interfaces:
IntComparator, Column, NumberColumn, Metadata, Constants, RowComparator, Serializable

public class IdColumn
extends ConstantColumn

Class IdColumn

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

Field Summary
 
Fields inherited from interface infovis.metadata.Constants
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE
 
Constructor Summary
IdColumn()
           
IdColumn(int size)
           
 
Method Summary
 int compare(int row1, int row2)
          
 String format(int v)
          Returns the string representation of a value according to the current format.
 int get(int row)
           
 double getDoubleAt(int row)
          Returns the value as a double.
 int getMaxIndex()
          Returns an the index of a row containing the maximum value of this column or -1 if the column has only undefined values or is empty.
 int getMinIndex()
          Returns an the index of a row containing the minimum value of this column or -1 if the column has only undefined values or is empty.
 String getName()
          Returns the column name.
 int getSize()
           
 Class getValueClass()
          Returns the class of the elements.
 boolean hasUndefinedValue()
          Returns true if the columns contains undefined values, false otherwise.
 boolean isValueUndefined(int i)
          Returns true if the ith value is undefined.
 int lastValidRow()
           
 int parse(String v)
          Parse a string and return the value for the column.
 double round(double value)
          Returns the rounded value according to the semantics of this number value.
 void set(int row)
           
 void setSize(int i)
          Sets the size of this column.
 void setValueAt(int index, String element)
          Replaces the element at the specified position in this column with the element specified in its String representation or sets if undefined if the element is null It will be read and translated using the Format.
 void setValueUndefined(int i, boolean undef)
          Sets the ith element to have an undefined value.
 int size()
          Returns the number of elements in this column.
 
Methods inherited from class infovis.column.ConstantColumn
addChangeListener, addValue, addValueOrNull, capacity, clear, disableNotify, enableNotify, ensureCapacity, format, getClientProperty, getDoubleMax, getDoubleMin, getFloatAt, getFormat, getIntAt, getLongAt, getMetadata, getValueAt, isEmpty, isInternal, iterator, removeChangeListener, setDoubleAt, setFloatAt, setFormat, setIntAt, setLongAt, setName, setValueOrNullAt
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cern.colt.function.IntComparator
equals
 

Constructor Detail

IdColumn

public IdColumn(int size)

IdColumn

public IdColumn()
Method Detail

getName

public String getName()
Description copied from class: ConstantColumn
Returns the column name.

Specified by:
getName in interface Column
Overrides:
getName in class ConstantColumn
Returns:
the column name.

getMinIndex

public int getMinIndex()
Description copied from class: ConstantColumn
Returns an the index of a row containing the minimum value of this column or -1 if the column has only undefined values or is empty.

Specified by:
getMinIndex in interface Column
Overrides:
getMinIndex in class ConstantColumn
Returns:
the index of a row containing the minium value of this column.

getMaxIndex

public int getMaxIndex()
Description copied from class: ConstantColumn
Returns an the index of a row containing the maximum value of this column or -1 if the column has only undefined values or is empty.

Specified by:
getMaxIndex in interface Column
Overrides:
getMaxIndex in class ConstantColumn
Returns:
the index of a row containing the maximum value of this column.

get

public int get(int row)

set

public void set(int row)

getDoubleAt

public double getDoubleAt(int row)
Description copied from class: ConstantColumn
Returns the value as a double.

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

round

public double round(double value)
Description copied from class: ConstantColumn
Returns the rounded value according to the semantics of this number value.

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

parse

public int parse(String v)
          throws ParseException
Parse a string and return the value for the column.

Parameters:
v - the string representation of the value
Returns:
the value
Throws:
ParseException - if the value cannot be parsed

format

public String format(int v)
Returns the string representation of a value according to the current format.

Parameters:
v - the value
Returns:
the string representation.

size

public int size()
Description copied from class: ConstantColumn
Returns the number of elements in this column.

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

hasUndefinedValue

public boolean hasUndefinedValue()
Description copied from class: ConstantColumn
Returns true if the columns contains undefined values, false otherwise.

Specified by:
hasUndefinedValue in interface Column
Overrides:
hasUndefinedValue in class ConstantColumn
Returns:
true if the columns contains undefined values, false otherwise.

getValueClass

public Class getValueClass()
Description copied from class: ConstantColumn
Returns the class of the elements.

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

isValueUndefined

public boolean isValueUndefined(int i)
Description copied from class: ConstantColumn
Returns true if the ith value is undefined.

Specified by:
isValueUndefined in interface Column
Specified by:
isValueUndefined in interface RowComparator
Overrides:
isValueUndefined in class ConstantColumn
Parameters:
i - the index
Returns:
true if the ith value is undefined.

lastValidRow

public int lastValidRow()

setValueAt

public void setValueAt(int index,
                       String element)
                throws ParseException
Description copied from class: ConstantColumn
Replaces the element at the specified position in this column with the element specified in its String representation or sets if undefined if the element is null It will be read and translated using the Format. A null value sets the value to undefined. The column is extended if needed.

Specified by:
setValueAt in interface Column
Overrides:
setValueAt in class ConstantColumn
Parameters:
index - index of element to replace.
element - element to be stored at the specified position.
Throws:
ParseException - if the specified string cannot be parsed.

setValueUndefined

public void setValueUndefined(int i,
                              boolean undef)
Description copied from class: ConstantColumn
Sets the ith element to have an undefined value.

Specified by:
setValueUndefined in interface Column
Overrides:
setValueUndefined in class ConstantColumn
Parameters:
i - the index
undef - true if the value should be undefined, false otherwise.

compare

public int compare(int row1,
                   int row2)
Description copied from class: ConstantColumn

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

getSize

public int getSize()

setSize

public void setSize(int i)
Description copied from class: ConstantColumn
Sets the size of this column.

Some column will ignore this request.

Specified by:
setSize in interface Column
Overrides:
setSize in class ConstantColumn
Parameters:
i - the new size.


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