|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.data.filter.column.FilterColumnTable
public final class FilterColumnTable
This DataTable
filters (includes or excludes) a specified number of
columns from a given table by just wrapping the underlying data table.
These columns can be either filtered by a particular column DataType
,
by a list of column names, or indices whereby the ordering is maintained.
Note, it is not possible to select a column twice from the given table.
The ordering of the final table is depending on the order of the column names resp. column indices.
Constructor Summary | |
---|---|
FilterColumnTable(DataTable data,
boolean include,
int... columns)
Inits a new filter column table based on a DataTable and an
unique, unordered number of column indices. |
|
FilterColumnTable(DataTable data,
Class<? extends DataValue> value)
Inits a new filter column table based on a DataTable and a
DataValue class as value. |
|
FilterColumnTable(DataTable data,
DataType type)
Inits a new filter column table based on a DataTable and one
type (DataCell ))
using Class to extract these columns. |
|
FilterColumnTable(DataTable data,
int... columns)
Inits a new filter column table based on a DataTable and an
unique, unordered number of column indices. |
|
FilterColumnTable(DataTable data,
String... columns)
Inits a new filter column table based on a DataTable and a
unique, unordered number of column names. |
Method Summary | |
---|---|
static DataTableSpec |
createFilterTableSpec(DataTableSpec spec,
boolean include,
int... columns)
This function constructs a spec for this filter table. |
static DataTableSpec |
createFilterTableSpec(DataTableSpec spec,
int... columns)
This function constructs a spec for this filter table. |
static DataTableSpec |
createFilterTableSpec(DataTableSpec spec,
String... columns)
Calls createFilterTableSpec(DataTableSpec, int[]) arguments with
the correct values in the int[] argument, i.e. |
int[] |
getColumnIndices()
|
DataTableSpec |
getDataTableSpec()
Returns the DataTableSpec object of this table which gives
information about the structure of this data table. |
RowIterator |
iterator()
Returns a row iterator which returns each row one-by-one from the table. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FilterColumnTable(DataTable data, boolean include, int... columns)
DataTable
and an
unique, unordered number of column indices.
data
- the underlying data tablecolumns
- the column indices to INCLUDE or EXCLUDE from the tableinclude
- if true
the columns are INCLUDEd otherwise
EXCLUDEd
ArrayIndexOutOfBoundsException
- if one of the column indices lies
not within the table's column range
IllegalArgumentException
- if the data
or
columns
are null
, or column
indices are out of range or appear as duplicates in the arraypublic FilterColumnTable(DataTable data, int... columns)
DataTable
and an
unique, unordered number of column indices.
data
- the underlying data tablecolumns
- the column indices to INCLUDE in the new table
NullPointerException
- if one of the args is null
ArrayIndexOutOfBoundsException
- if one of the column indices lies
not within the table's column range
IllegalArgumentException
- if the column indices are empty or one
of the column indices is used twicepublic FilterColumnTable(DataTable data, String... columns)
DataTable
and a
unique, unordered number of column names.
data
- the underlying data tablecolumns
- the column name to filter
NullPointerException
- if one of the args is null
IllegalArgumentException
- if one of the column name is already is
use or the column name does not exist in the table.public FilterColumnTable(DataTable data, DataType type)
DataTable
and one
type (DataCell
))
using Class
to extract these columns.
data
- the underlying tabletype
- the column type to be extractedt
IllegalArgumentException
- if the given type does not appear in the
tablepublic FilterColumnTable(DataTable data, Class<? extends DataValue> value)
DataTable
and a
DataValue
class as value. This table will contain all columns
from data
which are compatible to value
.
data
- the underlying tablevalue
- the compatible value type to be included
NullPointerException
- if any argument is null
Method Detail |
---|
public static final DataTableSpec createFilterTableSpec(DataTableSpec spec, String... columns)
createFilterTableSpec(DataTableSpec, int[])
arguments with
the correct values in the int[]
argument, i.e. it will
locate the columns and assign the "right" values.
spec
- the input speccolumns
- the names of the columns that should survive
IndexOutOfBoundsException
- if columns are no available
NullPointerException
- if either argument is null
or
contains null
valuespublic static final DataTableSpec createFilterTableSpec(DataTableSpec spec, boolean include, int... columns)
spec
- the input specinclude
- whether the column indices are to include or excludecolumns
- the output column indices to extract from the input spec
IndexOutOfBoundsException
- if columns not available
NullPointerException
- if either argument is null
or
contains null
valuespublic static final DataTableSpec createFilterTableSpec(DataTableSpec spec, int... columns)
spec
- the input speccolumns
- The output column indices to extract from the input spect
IndexOutOfBoundsException
- if columns are not availablea
NullPointerException
- if either argument is null or contains null
valuespublic int[] getColumnIndices()
public DataTableSpec getDataTableSpec()
DataTableSpec
object of this table which gives
information about the structure of this data table.
getDataTableSpec
in interface DataTable
public RowIterator iterator()
iterator
in interface Iterable<DataRow>
iterator
in interface DataTable
DataRow
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |