Search in sources :

Example 1 with FilterDefinitionHandlerPortObject

use of org.knime.core.node.port.viewproperty.FilterDefinitionHandlerPortObject in project knime-core by knime.

the class FilterApplyNodeModel method execute.

/**
 * {@inheritDoc}
 */
@Override
protected PortObject[] execute(final PortObject[] inObjects, final ExecutionContext exec) throws Exception {
    exec.setProgress(0);
    PortObject portObject = inObjects[1];
    DataTableSpec filterSpec = portObject == null ? ((BufferedDataTable) inObjects[0]).getDataTableSpec() : ((FilterDefinitionHandlerPortObject) portObject).getSpec();
    final BufferedDataTableRowOutput out = new BufferedDataTableRowOutput(exec.createDataContainer(((BufferedDataTable) inObjects[0]).getDataTableSpec()));
    execute(new DataTableRowInput((BufferedDataTable) inObjects[0]), out, filterSpec, exec, ((BufferedDataTable) inObjects[0]).size());
    return new BufferedDataTable[] { out.getDataTable() };
}
Also used : DataTableSpec(org.knime.core.data.DataTableSpec) BufferedDataTable(org.knime.core.node.BufferedDataTable) DataTableRowInput(org.knime.core.node.streamable.DataTableRowInput) FilterDefinitionHandlerPortObject(org.knime.core.node.port.viewproperty.FilterDefinitionHandlerPortObject) PortObject(org.knime.core.node.port.PortObject) BufferedDataTableRowOutput(org.knime.core.node.streamable.BufferedDataTableRowOutput)

Example 2 with FilterDefinitionHandlerPortObject

use of org.knime.core.node.port.viewproperty.FilterDefinitionHandlerPortObject in project knime-core by knime.

the class FilterApplyRowSplitterNodeModel method execute.

/**
 * {@inheritDoc}
 */
@Override
protected PortObject[] execute(final PortObject[] inObjects, final ExecutionContext exec) throws Exception {
    exec.setProgress(0);
    PortObject portObject = inObjects[1];
    DataTableSpec filterSpec = portObject == null ? ((BufferedDataTable) inObjects[0]).getDataTableSpec() : ((FilterDefinitionHandlerPortObject) portObject).getSpec();
    final BufferedDataTableRowOutput out1 = new BufferedDataTableRowOutput(exec.createDataContainer(((BufferedDataTable) inObjects[0]).getDataTableSpec()));
    final BufferedDataTableRowOutput out2 = new BufferedDataTableRowOutput(exec.createDataContainer(((BufferedDataTable) inObjects[0]).getDataTableSpec()));
    execute(new DataTableRowInput((BufferedDataTable) inObjects[0]), out1, out2, filterSpec, exec, ((BufferedDataTable) inObjects[0]).size());
    return new BufferedDataTable[] { out1.getDataTable(), out2.getDataTable() };
}
Also used : DataTableSpec(org.knime.core.data.DataTableSpec) BufferedDataTable(org.knime.core.node.BufferedDataTable) DataTableRowInput(org.knime.core.node.streamable.DataTableRowInput) FilterDefinitionHandlerPortObject(org.knime.core.node.port.viewproperty.FilterDefinitionHandlerPortObject) PortObject(org.knime.core.node.port.PortObject) BufferedDataTableRowOutput(org.knime.core.node.streamable.BufferedDataTableRowOutput)

Aggregations

DataTableSpec (org.knime.core.data.DataTableSpec)2 BufferedDataTable (org.knime.core.node.BufferedDataTable)2 PortObject (org.knime.core.node.port.PortObject)2 FilterDefinitionHandlerPortObject (org.knime.core.node.port.viewproperty.FilterDefinitionHandlerPortObject)2 BufferedDataTableRowOutput (org.knime.core.node.streamable.BufferedDataTableRowOutput)2 DataTableRowInput (org.knime.core.node.streamable.DataTableRowInput)2