use of org.knime.core.data.def.ComplexNumberCell in project knime-core by knime.
the class NodeSettingsTest method testDataCell.
/**
* Test write/read of DataCells.
*
* @throws Exception Should not happen.
*/
@Test
public void testDataCell() throws Exception {
StringCell s = new StringCell("stringi");
m_settings.addDataCell("string", s);
assertTrue(m_settings.containsKey("string"));
assertTrue(m_settings.getDataCell("string").equals(s));
DoubleCell d = new DoubleCell(45.42);
m_settings.addDataCell("double", d);
assertTrue(m_settings.containsKey("double"));
assertTrue(m_settings.getDataCell("double").equals(d));
IntCell i = new IntCell(11);
m_settings.addDataCell("int", i);
assertTrue(m_settings.containsKey("int"));
assertTrue(m_settings.getDataCell("int").equals(i));
DataCell m = DataType.getMissingCell();
m_settings.addDataCell("missing", m);
assertTrue(m_settings.containsKey("missing"));
assertTrue(m_settings.getDataCell("missing").equals(m));
ComplexNumberCell c = new ComplexNumberCell(5.4, 4.5);
m_settings.addDataCell("complex", c);
assertTrue(m_settings.containsKey("complex"));
assertTrue(m_settings.getDataCell("complex").equals(c));
FuzzyNumberCell n = new FuzzyNumberCell(1, 2, 4);
m_settings.addDataCell("fnumber", n);
assertTrue(m_settings.containsKey("fnumber"));
assertTrue(m_settings.getDataCell("fnumber").equals(n));
FuzzyIntervalCell f = new FuzzyIntervalCell(1, 2, 3, 4);
m_settings.addDataCell("finterval", f);
assertTrue(m_settings.containsKey("finterval"));
assertTrue(m_settings.getDataCell("finterval").equals(f));
DataCell unknownCell = new UnknownCell();
m_settings.addDataCell("unknownCell", unknownCell);
assertTrue(m_settings.containsKey("unknownCell"));
assertTrue(m_settings.getDataCell("unknownCell").equals(unknownCell));
}
Aggregations