use of org.knime.core.data.def.DefaultRow in project knime-core by knime.
the class TwoSampleTTestNodeModel method getLeveneStatistices.
/**
* Get the table with the Levene-Test statistics
* @param leveneResult the Levene-Test results
* @param exec the execution context
* @return the table with the Levene-Test statistics
*/
private BufferedDataTable getLeveneStatistices(final LeveneTestStatistics[] leveneResult, final ExecutionContext exec) {
BufferedDataContainer cont = exec.createDataContainer(LeveneTestStatistics.getTableSpec());
int r = 0;
for (int i = 0; i < leveneResult.length; i++) {
for (List<DataCell> cells : leveneResult[i].getTTestCells()) {
cont.addRowToTable(new DefaultRow(RowKey.createRowKey(r), cells));
r++;
}
}
cont.close();
return cont.getTable();
}
use of org.knime.core.data.def.DefaultRow in project knime-core by knime.
the class TwoSampleTTestNodeModel method getTestStatisticsTable.
/**
* Get table with test statistics
* @param result test statistic
* @param exec the execution context
* @return a combined table of the test statistic
*/
private BufferedDataTable getTestStatisticsTable(final TwoSampleTTestStatistics[] result, final ExecutionContext exec) {
BufferedDataContainer cont = exec.createDataContainer(TwoSampleTTestStatistics.getTableSpec());
int r = 0;
for (int i = 0; i < result.length; i++) {
for (List<DataCell> cells : result[i].getTTestCells()) {
cont.addRowToTable(new DefaultRow(RowKey.createRowKey(r), cells));
r++;
}
}
cont.close();
return cont.getTable();
}
use of org.knime.core.data.def.DefaultRow in project knime-core by knime.
the class DateGeneratorNodeModel method execute.
/**
* {@inheritDoc}
*/
@Override
protected BufferedDataTable[] execute(final BufferedDataTable[] inData, final ExecutionContext exec) throws Exception {
// prepare the calendars
Calendar from = m_from.getCalendar();
// new since 2.8. the start time is the current time.
if (m_useExecution.getBooleanValue()) {
from = DateAndTimeCell.getUTCCalendar();
from.setTimeInMillis(System.currentTimeMillis() + TimeZone.getDefault().getOffset(System.currentTimeMillis()));
}
Calendar to = m_to.getCalendar();
// if the use execution time is set, we ignore the settings for the from date
boolean useDate = (m_from.useDate() && !m_useExecution.getBooleanValue()) || m_to.useDate();
boolean useTime = (m_from.useTime() && !m_useExecution.getBooleanValue()) || m_to.useTime();
boolean useMillis = (m_from.useMilliseconds() && !m_useExecution.getBooleanValue()) || m_to.useMilliseconds();
if (useDate && !useTime) {
DateAndTimeCell.resetTimeFields(from);
DateAndTimeCell.resetTimeFields(to);
} else if (useTime && !useDate) {
DateAndTimeCell.resetDateFields(from);
DateAndTimeCell.resetDateFields(to);
}
if (!useMillis) {
from.clear(Calendar.MILLISECOND);
to.clear(Calendar.MILLISECOND);
}
BufferedDataContainer container = exec.createDataContainer(createOutSpec());
int nrRows = m_noOfRows.getIntValue();
double offset = calculateOffset(from, to, nrRows);
double currentTime = from.getTimeInMillis();
for (int i = 0; i < nrRows; i++) {
// zero based row key as FileReader
RowKey key = new RowKey("Row" + i);
DateAndTimeCell cell = new DateAndTimeCell((long) Math.ceil(currentTime), useDate, useTime, useMillis);
container.addRowToTable(new DefaultRow(key, cell));
currentTime += offset;
exec.setProgress((i + 1) / (double) nrRows, "Generating row #" + (i + 1));
exec.checkCanceled();
}
container.close();
return new BufferedDataTable[] { exec.createBufferedDataTable(container.getTable(), exec) };
}
use of org.knime.core.data.def.DefaultRow in project knime-core by knime.
the class JoinedTableRowIterator method getLeftMissing.
/* Called when there is no corresponding left row to the right one. */
private DataRow getLeftMissing(final RowKey key) {
DataTableSpec spec = m_table.getLeftTable().getDataTableSpec();
if (m_leftMissingCells == null) {
LOGGER.debug("Creating missing values for top table on key \"" + key + "\"");
if (!m_table.isPrintedErrorOnMissing()) {
printMissingError(true);
m_table.setPrintedErrorOnMissing(true);
}
m_leftMissingCells = JoinedTable.createMissingCells(spec);
}
return new DefaultRow(key, m_leftMissingCells);
}
use of org.knime.core.data.def.DefaultRow in project knime-core by knime.
the class JoinedTableRowIterator method getRightMissing.
/* Called when there is no corresponding right row to the left one. */
private DataRow getRightMissing(final RowKey key) {
DataTableSpec spec = m_table.getRightTable().getDataTableSpec();
if (m_rightMissingCells == null) {
LOGGER.debug("Creating missing values for bottom table on key \"" + key + "\"");
if (!m_table.isPrintedErrorOnMissing()) {
printMissingError(false);
m_table.setPrintedErrorOnMissing(true);
}
m_rightMissingCells = JoinedTable.createMissingCells(spec);
}
return new DefaultRow(key, m_rightMissingCells);
}
Aggregations