Search in sources :

Example 91 with DataRow

use of org.knime.core.data.DataRow in project knime-core by knime.

the class DoubleCellFilterRowGeneratorTest method testTwoBorder1.

/**
 * Test on left and right border using <b>3.0</b>.
 */
public void testTwoBorder1() {
    DataRow row = new MyTestRow(3.0);
    FilterRowGenerator gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_IN, m_dblRight, RIGHT_IN);
    assertTrue(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_OUT, m_dblRight, RIGHT_IN);
    assertTrue(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_IN, m_dblRight, RIGHT_OUT);
    assertTrue(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_OUT, m_dblRight, RIGHT_OUT);
    assertTrue(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_IN, m_dblRight, LEFT_IN);
    assertFalse(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_OUT, m_dblRight, LEFT_OUT);
    assertFalse(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_OUT, m_dblRight, LEFT_IN);
    assertFalse(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_IN, m_dblRight, LEFT_OUT);
    assertFalse(gen.isIn(row));
}
Also used : DataRow(org.knime.core.data.DataRow)

Example 92 with DataRow

use of org.knime.core.data.DataRow in project knime-core by knime.

the class DoubleCellFilterRowGeneratorTest method testOneBorder3.

/**
 * Test on left border using <b>7.0</b>.
 */
public void testOneBorder3() {
    DataRow row = new MyTestRow(7.0);
    FilterRowGenerator gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_IN);
    assertFalse(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_OUT);
    assertFalse(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_IN);
    assertTrue(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_OUT);
    assertTrue(gen.isIn(row));
}
Also used : DataRow(org.knime.core.data.DataRow)

Example 93 with DataRow

use of org.knime.core.data.DataRow in project knime-core by knime.

the class DoubleCellFilterRowGeneratorTest method testTwoBorder5.

/**
 * Test on left and right border using <b>9.0</b>.
 */
public void testTwoBorder5() {
    DataRow row = new MyTestRow(9.0);
    FilterRowGenerator gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_IN, m_dblRight, RIGHT_IN);
    assertTrue(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_OUT, m_dblRight, RIGHT_IN);
    assertTrue(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_IN, m_dblRight, RIGHT_OUT);
    assertTrue(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_OUT, m_dblRight, RIGHT_OUT);
    assertTrue(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_IN, m_dblRight, LEFT_IN);
    assertFalse(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_OUT, m_dblRight, LEFT_OUT);
    assertFalse(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_OUT, m_dblRight, LEFT_IN);
    assertFalse(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_IN, m_dblRight, LEFT_OUT);
    assertFalse(gen.isIn(row));
}
Also used : DataRow(org.knime.core.data.DataRow)

Example 94 with DataRow

use of org.knime.core.data.DataRow in project knime-core by knime.

the class DoubleCellFilterRowGeneratorTest method testTwoBorder2.

/**
 * Test on left and right border using <b>5.0</b>.
 */
public void testTwoBorder2() {
    DataRow row = new MyTestRow(5.0);
    FilterRowGenerator gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_IN, m_dblRight, RIGHT_IN);
    assertTrue(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_OUT, m_dblRight, RIGHT_IN);
    assertFalse(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_IN, m_dblRight, RIGHT_OUT);
    assertTrue(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_OUT, m_dblRight, RIGHT_OUT);
    assertFalse(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_IN, m_dblRight, LEFT_IN);
    assertTrue(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_OUT, m_dblRight, LEFT_OUT);
    assertFalse(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_OUT, m_dblRight, LEFT_IN);
    assertFalse(gen.isIn(row));
    gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_IN, m_dblRight, LEFT_OUT);
    assertTrue(gen.isIn(row));
}
Also used : DataRow(org.knime.core.data.DataRow)

Example 95 with DataRow

use of org.knime.core.data.DataRow in project knime-core by knime.

the class JoinedTableTest method testMergedTable.

/**
 * Test for constructor.
 */
public final void testMergedTable() {
    DataColumnSpec[] leftCols = new DataColumnSpec[3];
    DataColumnSpec[] rightCols = new DataColumnSpec[3];
    System.arraycopy(COLS, 0, leftCols, 0, 3);
    System.arraycopy(COLS, 3, rightCols, 0, 3);
    DataTable leftTable = new DefaultTable(new DataRow[0], new DataTableSpec(leftCols));
    DataTable rightTable = new DefaultTable(new DataRow[0], new DataTableSpec(rightCols));
    new JoinedTable(leftTable, rightTable);
    try {
        new JoinedTable(null, rightTable);
        fail();
    } catch (NullPointerException ne) {
        NodeLogger.getLogger(JoinedTableTest.class).debug("Got expected exception: " + ne.getClass(), ne);
    }
    try {
        new JoinedTable(leftTable, null);
        fail();
    } catch (NullPointerException ne) {
        NodeLogger.getLogger(JoinedTableTest.class).debug("Got expected exception: " + ne.getClass(), ne);
    }
    try {
        new JoinedTable(leftTable, leftTable);
        fail();
    } catch (IllegalArgumentException iae) {
        NodeLogger.getLogger(JoinedTableTest.class).debug("Got expected exception: " + iae.getClass(), iae);
    }
    try {
        new JoinedTable(leftTable, leftTable);
        fail();
    } catch (IllegalArgumentException iae) {
        NodeLogger.getLogger(JoinedTableTest.class).debug("Got expected exception: " + iae.getClass(), iae);
    }
    rightCols[1] = leftCols[2];
    rightTable = new DefaultTable(new DataRow[0], new DataTableSpec(rightCols));
    try {
        new JoinedTable(leftTable, rightTable);
        fail();
    } catch (IllegalArgumentException iae) {
        NodeLogger.getLogger(JoinedTableTest.class).debug("Got expected exception: " + iae.getClass(), iae);
    }
}
Also used : DataTable(org.knime.core.data.DataTable) DataTableSpec(org.knime.core.data.DataTableSpec) DataColumnSpec(org.knime.core.data.DataColumnSpec) DefaultTable(org.knime.core.data.def.DefaultTable) DataRow(org.knime.core.data.DataRow)

Aggregations

DataRow (org.knime.core.data.DataRow)482 DataCell (org.knime.core.data.DataCell)268 DataTableSpec (org.knime.core.data.DataTableSpec)159 BufferedDataTable (org.knime.core.node.BufferedDataTable)125 DataColumnSpec (org.knime.core.data.DataColumnSpec)109 RowKey (org.knime.core.data.RowKey)88 DefaultRow (org.knime.core.data.def.DefaultRow)88 BufferedDataContainer (org.knime.core.node.BufferedDataContainer)80 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)76 ColumnRearranger (org.knime.core.data.container.ColumnRearranger)73 DoubleValue (org.knime.core.data.DoubleValue)72 ArrayList (java.util.ArrayList)65 DataColumnSpecCreator (org.knime.core.data.DataColumnSpecCreator)65 RowIterator (org.knime.core.data.RowIterator)62 DataType (org.knime.core.data.DataType)61 DoubleCell (org.knime.core.data.def.DoubleCell)57 StringCell (org.knime.core.data.def.StringCell)53 SingleCellFactory (org.knime.core.data.container.SingleCellFactory)48 ExecutionMonitor (org.knime.core.node.ExecutionMonitor)44 CanceledExecutionException (org.knime.core.node.CanceledExecutionException)43