|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object infovis.utils.ChangeManager infovis.column.AbstractColumn infovis.column.BasicColumn infovis.column.IntSparseColumn
public class IntSparseColumn
Class IntSparseColumn
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 | |
---|---|
IntSparseColumn(String name)
|
Method Summary | |
---|---|
void |
add(int element)
Adds a new element in the column, |
int |
capacity()
Returns the current capacity of this column. |
void |
clear()
Removes all of the elements from this column. |
int |
compare(int row1,
int row2)
|
boolean |
compareValues(Column c)
Compare the values of this column and the specified column. |
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. |
static IntSparseColumn |
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)
|
static IntSparseColumn |
getColumn(Table t,
int index)
Returns a column as a IntColumn from an Table . |
static IntSparseColumn |
getColumn(Table t,
String name)
Returns a column as an IntColumn from a Table . |
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. |
int |
getMax()
|
int |
getMin()
|
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. |
IntIntSortedMap |
getValueReference()
|
boolean |
hasUndefinedValue()
Returns true if the columns contains
undefined values, false otherwise. |
boolean |
isValueUndefined(int i)
Returns true if the ith value is undefined. |
RowIterator |
iterator()
Returns a RowIterator over all the valid rows of this column. |
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)
|
void |
setDoubleAt(int row,
double v)
Sets the value as a double. |
void |
setExtend(int index,
int element)
|
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. |
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. |
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. |
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.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 |
---|
public IntSparseColumn(String name)
Method Detail |
---|
public void setSize(int newSize)
BasicColumn
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 BasicColumn
newSize
- the new sizeColumn of this column.public boolean isValueUndefined(int i)
Column
isValueUndefined
in interface Column
isValueUndefined
in interface RowComparator
i
- the index
public void setValueUndefined(int i, boolean undef)
Column
setValueUndefined
in interface Column
i
- the indexundef
- true if the value should be undefined,
false otherwise.public int size()
Column
size
in interface Column
public boolean hasUndefinedValue()
Column
true
if the columns contains
undefined values, false
otherwise.
hasUndefinedValue
in interface Column
true
if the columns contains
undefined values, false
otherwise.public void clear()
BasicColumn
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 BasicColumn
public boolean compareValues(Column c)
AbstractColumn
compareValues
in class AbstractColumn
c
- the column to compare values from
true
if the values match, false
otherwisepublic int capacity()
Column
capacity
in interface Column
public int get(int index)
public void set(int index, int element)
public void setExtend(int index, int element)
public void add(int element)
element
- the element.public 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 static IntSparseColumn 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 IntSparseColumn 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 IntSparseColumn 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()
BasicColumn
getValueClass
in interface Column
getValueClass
in class BasicColumn
Column.getValueClass()
public double getDoubleAt(int row)
NumberColumn
getDoubleAt
in interface NumberColumn
row
- the row
NumberColumn.getDoubleAt(int)
public float getFloatAt(int row)
NumberColumn
getFloatAt
in interface NumberColumn
row
- the row
NumberColumn.getFloatAt(int)
public int getIntAt(int row)
NumberColumn
getIntAt
in interface NumberColumn
row
- the row
NumberColumn.getIntAt(int)
public long getLongAt(int row)
NumberColumn
getLongAt
in interface NumberColumn
row
- the row
NumberColumn.getLongAt(int)
public void setDoubleAt(int row, double v)
NumberColumn
setDoubleAt
in interface NumberColumn
row
- the rowv
- the value as a doubleNumberColumn.setDoubleAt(int, double)
public void setIntAt(int row, int v)
NumberColumn
setIntAt
in interface NumberColumn
row
- the rowv
- the value as an intNumberColumn.setIntAt(int, int)
public void setLongAt(int row, long v)
NumberColumn
setLongAt
in interface NumberColumn
row
- the rowv
- the value as a longNumberColumn.setLongAt(int, long)
public double round(double value)
NumberColumn
round
in interface NumberColumn
value
- the value to round
NumberColumn.round(double)
public String format(double value)
NumberColumn
format
in interface NumberColumn
value
- the value to format
public void ensureCapacity(int minCapacity)
Column
ensureCapacity
in interface Column
minCapacity
- the desired minimum capacity.public String getValueAt(int i)
Column
null
if
the element is undefined. The representation is
generated by the current format.
getValueAt
in interface Column
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.
setValueAt
in interface Column
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 IntIntSortedMap getValueReference()
public void setFloatAt(int row, float v)
NumberColumn
setFloatAt
in interface NumberColumn
row
- the rowv
- the value as a floatpublic int getMin()
public int getMax()
public double getDoubleMin()
NumberColumn
getDoubleMin
in interface NumberColumn
public double getDoubleMax()
NumberColumn
getDoubleMax
in interface NumberColumn
public int[] toArray(int[] a)
a
- an array of int with at least the column size or
null
.
public int[] toArray()
public RowIterator iterator()
BasicColumn
iterator
in interface Column
iterator
in class BasicColumn
public int compare(int row1, int row2)
BasicColumn
compare
in interface IntComparator
compare
in class BasicColumn
IntComparator.compare(int,int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |