|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfovis.utils.ChangeManager
infovis.column.AbstractColumn
infovis.column.BasicColumn
infovis.column.LiteralColumn
infovis.column.IntColumn
public class IntColumn
A Column of integer values.
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 | |
---|---|
IntColumn(String name)
Creates a new IntColumn object. |
|
IntColumn(String name,
int reserve)
Creates a new IntColumn object. |
|
IntColumn(String name,
IntArrayList value)
Creates a new IntColumn object backed on a colt IntArrayList. |
Method Summary | |
---|---|
void |
add(int element)
Adds a new element in the column. |
int |
addExtend(int index,
int v)
Adds the value of the column at the specified row with the specified value. |
int |
capacity()
Returns the current capacity of this column. |
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. |
void |
ensureCapacity(int minCapacity)
Increases the capacity of this column, if necessary, to ensure that it can hold at least the number of values specified by the minimum capacity argument. |
void |
fill(int val)
Fills the column with the specified value. |
static IntColumn |
findColumn(Table t,
String name)
Returns a column as a IntColumn from a table, creating it
if needed. |
String |
format(double value)
Returns the specified value formatted according to this column's format. |
String |
format(int v)
Returns the string representation of a value according to the current format. |
int |
get(int index)
Returns the element at the specified position in this column. |
static IntColumn |
getColumn(Table t,
int index)
Returns a column as a IntColumn from an Table . |
static IntColumn |
getColumn(Table t,
String name)
Returns a column as an IntColumn from a Table . |
double |
getDoubleAt(int row)
Returns the 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 |
int |
getMax()
Returns the maximum value of this column. |
int |
getMin()
Returns the minum value of this column. |
String |
getValueAt(int i)
Returns the String representation of the element at the specified position in this column or null if
the element is undefined. |
Class |
getValueClass()
Returns the class of the elements. |
IntArrayList |
getValueReference()
Returns the DoubleArrayList backing the implementation of the column (USE WITH CARE). |
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 index,
int element)
Replaces the element at the specified position in this column with the specified element. |
void |
setDoubleAt(int row,
double v)
Sets the value as a double |
void |
setExtend(int index,
int element)
Replaces the element at the specified position in this column with the specified element, growing the column if necessary. |
void |
setIntAt(int row,
int v)
Sets the value as an int |
void |
setLongAt(int row,
long v)
Sets the value as a long |
void |
setSize(int newSize)
Sets the sizeColumn of this column. |
void |
setValueAt(int i,
String v)
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. |
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. |
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, 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 |
---|
addChangeListener, addValue, addValueOrNull, disableNotify, enableNotify, getFormat, getMaxIndex, getMinIndex, getName, isEmpty, isInternal, iterator, removeChangeListener, setFormat, setName, setValueOrNullAt |
Methods inherited from interface infovis.Metadata |
---|
getClientProperty, getMetadata |
Methods inherited from interface cern.colt.function.IntComparator |
---|
equals |
Constructor Detail |
---|
public IntColumn(String name)
name
- the column name.public IntColumn(String name, int reserve)
name
- the column name.reserve
- the initial allocated size.public IntColumn(String name, IntArrayList value)
name
- the column name.value
- the colt IntArrayList holding the values (not copied)Method Detail |
---|
public void clear()
CategoricalFormat
, it
is not cleared so results may not be what you expected. The
CategoricalFormat
can be cleared explicitely if
needed.
clear
in interface Column
clear
in class LiteralColumn
Call clear after clearing the subclass contents since this method fires
the notifications.
public int get(int index)
index
- index of element to return.
public void set(int index, int element)
index
- index of element to replace.element
- element to be stored at the specified position.public void setExtend(int index, int element)
index
- index of element to replace.element
- element to be stored at the specified position.public int addExtend(int index, int v)
index
- the row indexv
- the value to add
public void add(int element)
element
- the element.public void fill(int val)
val
- the valuepublic int parse(String v) throws ParseException
v
- the string representation of the value
ParseException
- if the value cannot be parsedpublic String format(int v)
v
- the value
public String getValueAt(int i)
Column
null
if
the element is undefined. The representation is
generated by the current format.
i
- index of element representation to return.
null
if the element is undefined.Column.getValueAt(int)
public void setValueAt(int i, String v) throws ParseException
Column
null
It will be read and translated using the Format. A null value
sets the value to undefined. The column is extended if
needed.
i
- index of element to replace.v
- element to be stored at the specified position.
ParseException
- if the specified string cannot be parsed.Column.setValueAt(int, String)
public static IntColumn getColumn(Table t, int index)
IntColumn
from an Table
.
t
- the Table
index
- index in the Table
IntColumn
or null if no such column exists or
the column is not a IntColumn
.public static IntColumn getColumn(Table t, String name)
IntColumn
from a Table
.
t
- the Table
name
- the column name.
IntColumn
or null if no such column exists or
the column is not a IntColumn
.public static IntColumn findColumn(Table t, String name)
IntColumn
from a table, creating it
if needed.
t
- the Table
name
- the column name.
IntColumn
from a table,public Class getValueClass()
getValueClass
in interface Column
getValueClass
in class BasicColumn
public double getDoubleAt(int row)
getDoubleAt
in interface NumberColumn
getDoubleAt
in class LiteralColumn
row
- the row
public float getFloatAt(int row)
getFloatAt
in interface NumberColumn
getFloatAt
in class LiteralColumn
row
- the row
public int getIntAt(int row)
getIntAt
in interface NumberColumn
getIntAt
in class LiteralColumn
row
- the row
public long getLongAt(int row)
getLongAt
in interface NumberColumn
getLongAt
in class LiteralColumn
row
- the row
public void setDoubleAt(int row, double v)
setDoubleAt
in interface NumberColumn
setDoubleAt
in class LiteralColumn
row
- the rowv
- the value as a doublepublic void setIntAt(int row, int v)
setIntAt
in interface NumberColumn
setIntAt
in class LiteralColumn
row
- the rowv
- the value as an intpublic void setLongAt(int row, long v)
setLongAt
in interface NumberColumn
setLongAt
in class LiteralColumn
row
- the rowv
- the value as a longpublic double round(double value)
round
in interface NumberColumn
round
in class LiteralColumn
value
- the value to round
public String format(double value)
value
- the value to format
public int getMin()
public int getMax()
public int[] toArray(int[] a)
a
- an array of int with at least the column size or
null
.
public int[] toArray()
public void sort(RowComparator comp)
comp
- the comparatorpublic void stableSort(RowComparator comp)
comp
- the comparatorpublic int capacity()
public void ensureCapacity(int minCapacity)
minCapacity
- the desired minimum capacity.public int size()
public void setSize(int newSize)
0
items
are added to the end of the column. If the new sizeColumn is
less than the current sizeColumn, all components at index
newSize
and greater are discarded.
setSize
in interface Column
setSize
in class LiteralColumn
newSize
- the new sizeColumn of this column.public IntArrayList getValueReference()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |