|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.node.util.DefaultDataArray
public class DefaultDataArray
Can be used to locally store a certain number of rows. It provides random access to the stored rows. It maintains the min and max value for each column (min/max with respect to the row sample stored - not the entire data table). These values can be changed, in case somebody knows better limits. It provides a list of all values seen for each string column (i.e. a list of all values appearing in the rows stored - not the entire data table). If the maximal number of possible values (2000) is exceeded, no possible values are available.
Constructor Summary | |
---|---|
DefaultDataArray(DataTable dTable,
int firstRow,
int numOfRows)
Constructs a random access container holding a certain number of rows from the data table passed in. |
|
DefaultDataArray(DataTable dTable,
int firstRow,
int numOfRows,
ExecutionMonitor execMon)
Same, but allows for user cancellation from a progress monitor, while the container is filled. |
Method Summary | |
---|---|
DataTableSpec |
getDataTableSpec()
Get the table spec corresponding the the rows. |
int |
getFirstRowNumber()
|
DataCell |
getMaxValue(int colIdx)
|
DataCell |
getMinValue(int colIdx)
|
DataRow |
getRow(int idx)
Returns the row from the container with index idx . |
Set<DataCell> |
getValues(int colIdx)
Returns a set of all different values seen in the specified column. |
RowIterator |
iterator()
Returns a row iterator which returns each row one-by-one from the table. |
void |
setMaxValue(int colIdx,
DataCell newMaxValue)
Sets a new max value for the specified column. |
void |
setMinValue(int colIdx,
DataCell newMinValue)
Sets a new min value for the specified column. |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultDataArray(DataTable dTable, int firstRow, int numOfRows)
firstRow
"
parameter (where the first row is number 1). The rows can be accessed by
index later on always starting with index zero.
dTable
- the data table to read the rows fromfirstRow
- the first row to store (must be greater than zero)numOfRows
- the number of rows to store (must be zero or more)public DefaultDataArray(DataTable dTable, int firstRow, int numOfRows, ExecutionMonitor execMon) throws CanceledExecutionException
dTable
- the data table to read the rows fromfirstRow
- the first row to store (must be greater than zero)numOfRows
- the number of rows to store (must be zero or more)execMon
- the object listening to our progress and providing cancel
functionality
CanceledExecutionException
- if the construction was canceledMethod Detail |
---|
public DataRow getRow(int idx)
idx
. Index
starts at zero and must be less than the size of the container (which
could be less than the number of rows requested at construction time as
the table could be shorter than that). The original row number in the
table can be reconstructed by adding the index to the result of the
DataArray.getFirstRowNumber()
method.
getRow
in interface DataArray
idx
- the index of the row to return (must be between 0 and size of
the row container)
idx
public Set<DataCell> getValues(int colIdx)
StringCell
(or derived from that).
The list will be in the order the values appeared in the rows read in. It
contains only the values showing in these rows, the complete table may
contain more values. The list doesn't contain "missing value" cells.
getValues
in interface DataArray
colIdx
- the index of the column to return the possible values for
null
for non-string columns.public DataCell getMinValue(int colIdx)
getMinValue
in interface DataArray
colIdx
- the index of the column to return the min value for
null
if the number of rows actually stored is
zero, or the column contains only missing cells.public DataCell getMaxValue(int colIdx)
getMaxValue
in interface DataArray
colIdx
- the index of the column to return the max value for
null
if the number of rows actually stored is
zero, or the column contains only missing cells.public void setMaxValue(int colIdx, DataCell newMaxValue)
colIdx
- the index of the column to set the new max value fornewMaxValue
- the new max value for the specified column. Must not
be null
and must fit the type of the column.public void setMinValue(int colIdx, DataCell newMinValue)
colIdx
- the index of the column to set the new min value for. Must
be between zero and the size of this container.newMinValue
- the new min value for the specified column. Must not
be null
and must fit the type of the column.public int size()
size
in interface DataArray
public int getFirstRowNumber()
getFirstRowNumber
in interface DataArray
i
in the container can be reconstructed by
i + getFirstRowNumber()
.public RowIterator iterator()
iterator
in interface Iterable<DataRow>
iterator
in interface DataArray
iterator
in interface DataTable
DataRow
to obtain the real type of the object.DataRow
public DataTableSpec getDataTableSpec()
getDataTableSpec
in interface DataArray
getDataTableSpec
in interface DataTable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |