public class SourceColumnsAsProperties extends Object
DataColumnProperties from the input column names for possible reverse of the
process.| Modifier and Type | Field and Description |
|---|---|
static String |
PROPKEY_SOURCE_COLUMN_INDICES
The key for the property containing the original column indices.
|
| Constructor and Description |
|---|
SourceColumnsAsProperties() |
| Modifier and Type | Method and Description |
|---|---|
static int[] |
indices(NameFilterConfiguration.FilterResult filterResult,
DataTableSpec input)
Finds the column indices for the included column names.
|
static int[] |
indices(String[] includes,
DataTableSpec input)
Finds the indices for the
includes column names. |
static String |
indicesAsString(int[] indices) |
static int[] |
indicesFrom(DataColumnSpec inputSpec) |
static List<String> |
sortNamesAccordingToIndex(List<String> names,
int[] indices)
Sorts the
names according to the indices ascending order. |
static DataColumnProperties |
toProperties(SettingsModelColumnFilter2 selection,
DataTableSpec input)
Creates the
DataColumnProperties with the
PROPKEY_SOURCE_COLUMN_INDICES keys to the column names and column values respectively. |
public static final String PROPKEY_SOURCE_COLUMN_INDICES
public static DataColumnProperties toProperties(SettingsModelColumnFilter2 selection, DataTableSpec input)
DataColumnProperties with the
PROPKEY_SOURCE_COLUMN_INDICES keys to the column names and column values respectively.selection - The model for the selected columns.input - The input DataTableSpec.public static String indicesAsString(int[] indices)
indices - An array of ints.indices encoded as a String.public static int[] indices(NameFilterConfiguration.FilterResult filterResult, DataTableSpec input)
filterResult - A NameFilterConfiguration.FilterResult.input - A DataTableSpec.input, else (not found case:)
-1public static int[] indices(String[] includes, DataTableSpec input)
includes column names.includes - The name of the columns.input - A DataTableSpec.input, else (not found case:)
-1public static int[] indicesFrom(DataColumnSpec inputSpec)
inputSpec - The input column spec, that contains the properties for indices.public static List<String> sortNamesAccordingToIndex(List<String> names, int[] indices) throws IllegalArgumentException
names according to the indices ascending order.names - Some Strings.indices - The (unique!) indices.names ordered by indices, if there are less indices, the rest of the names are copied to the end.IllegalArgumentException - There were duplicate values in indices.
KNIME GmbH, Konstanz, Germany
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.