当前位置: 首页>>代码示例>>Java>>正文


Java RowKey类代码示例

本文整理汇总了Java中org.knime.core.data.RowKey的典型用法代码示例。如果您正苦于以下问题:Java RowKey类的具体用法?Java RowKey怎么用?Java RowKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RowKey类属于org.knime.core.data包,在下文中一共展示了RowKey类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ActiveLearnLoopEndNodeModel

import org.knime.core.data.RowKey; //导入依赖的package包/类
/**
 *
 */
protected ActiveLearnLoopEndNodeModel() {
    super(new PortType[] { BufferedDataTable.TYPE,
            BufferedDataTable.TYPE_OPTIONAL, },
            new PortType[] { BufferedDataTable.TYPE });

    m_isExecuting = false;
    m_isTerminated = false;

    // empty row map if no input data is present, yet.
    m_rowMap = new HashMap<RowKey, DataRow>();

    m_classModel = new ClassModel();

    m_curIterationIndex = 0;
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:19,代码来源:ActiveLearnLoopEndNodeModel.java

示例2: createCellFactory

import org.knime.core.data.RowKey; //导入依赖的package包/类
/**
 * Creates a CellFactory for the class column.
 *
 * @param colName
 *            the name of the class column
 * @return CellFactory for the class column.
 */
private CellFactory createCellFactory(final String colName) {
    return new CellFactory() {

        @Override
        public void setProgress(final int curRowNr, final int rowCount,
                final RowKey lastKey, final ExecutionMonitor exec) {
            exec.setProgress((double) curRowNr / rowCount);
        }

        @Override
        public DataColumnSpec[] getColumnSpecs() {
            return new DataColumnSpec[] {
                    new DataColumnSpecCreator(colName, StringCell.TYPE)
                            .createSpec() };
        }

        @Override
        public DataCell[] getCells(final DataRow row) {
            throw new IllegalStateException(
                    new IllegalAccessException("This shouldn't be called"));
        }
    };
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:31,代码来源:ActiveLearnLoopStartNodeModel.java

示例3: createResRearranger

import org.knime.core.data.RowKey; //导入依赖的package包/类
private ColumnRearranger createResRearranger(final DataTableSpec inSpec) {
    final ColumnRearranger rearranger = new ColumnRearranger(inSpec);
    rearranger.append(new CellFactory() {

        @Override
        public void setProgress(final int curRowNr, final int rowCount,
                final RowKey lastKey, final ExecutionMonitor exec) {
            exec.setProgress((double) curRowNr / rowCount);

        }

        @Override
        public DataColumnSpec[] getColumnSpecs() {
            return new DataColumnSpec[] {
                    new DataColumnSpecCreator("Graph Density Score",
                            DoubleCell.TYPE).createSpec() };
        }

        @Override
        public DataCell[] getCells(final DataRow row) {
            return new DataCell[] { new DoubleCell(
                    m_dataPoints.get(row.getKey()).getDensity()) };
        }
    });
    return rearranger;
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:27,代码来源:GraphDensityScorerNodeModel.java

示例4: execute

import org.knime.core.data.RowKey; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected BufferedDataTable[] execute(final BufferedDataTable[] inData,
		final ExecutionContext exec) throws Exception {

	// create output table
	BufferedDataContainer container = exec
			.createDataContainer(new DataTableSpec(
					new DataColumnSpec[] { new DataColumnSpecCreator(
							"Column 0", LongCell.TYPE).createSpec() }));

	// add row with count
	container.addRowToTable(new DefaultRow(new RowKey("Row 0"),
			new LongCell[] { new LongCell(TableCellUtils.getRDD(inData[0])
					.count()) }));
	container.close();

	BufferedDataTable out = container.getTable();

	// update viewer
	rddViewer = new RddViewer(out, exec);

	return new BufferedDataTable[] { out };
}
 
开发者ID:pavloff-de,项目名称:spark4knime,代码行数:27,代码来源:CountNodeModel.java

示例5: endElement

import org.knime.core.data.RowKey; //导入依赖的package包/类
@Override
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
		throws SAXException
	{
	if(builder!=null)
		{
		DataRow row=new DefaultRow(RowKey.createRowKey(++rowOut),new IntCell(Integer.parseInt(builder.toString())));
		container.addRowToTable(row);
		exec.setProgress("ESearch "+(rowOut));
      		try {
			exec.checkCanceled();
		} catch (CanceledExecutionException e) {
			throw new SAXException(e);
		}
		}
	builder=null;
	}
 
开发者ID:lindenb,项目名称:knime4bio,代码行数:18,代码来源:ESearchNodeModel.java

示例6: endDocument

import org.knime.core.data.RowKey; //导入依赖的package包/类
@Override
public void endDocument() throws SAXException
	{
	if(this.countExported==0)
		{
		DataCell cells[]=new DataCell[8];
      		for(int i=0;i< cells.length;++i)
      			{
      			cells[i]=DataType.getMissingCell();
      			}
      		
      		this.container.addRowToTable(
      			new AppendedColumnRow(
      			RowKey.createRowKey(++outIndex),
      			this.row,
      			cells
      			)
      			);
		}
	}
 
开发者ID:lindenb,项目名称:knime4bio,代码行数:21,代码来源:DasFeaturesNodeModel.java

示例7: execute

import org.knime.core.data.RowKey; //导入依赖的package包/类
private int execute(int outIndex,List<Range> ranges,BufferedDataContainer container)
 throws Exception
 	 {
for(int i=0;i<ranges.size();++i)
	{
Range prev=(i>0?ranges.get(i-1):null);
Range mid=ranges.get(i);
Range next=(i+1< ranges.size()?ranges.get(i+1):null);

DataCell cells[]=new DataCell[]
            {
	  new StringCell(mid.chrom),
	  new IntCell(prev==null?mid.chromStart:prev.chromEnd+1),
	  new IntCell(next==null?mid.chromEnd:next.chromStart-1),
	  (mid.under?BooleanCell.FALSE:BooleanCell.TRUE),
	  new IntCell(mid.count),
	  new DoubleCell(mid.min),
	  new DoubleCell(mid.max),
	  new DoubleCell(mid.total/mid.count)
            };
container.addRowToTable(new DefaultRow(RowKey.createRowKey(++outIndex),cells));
	}
return outIndex;
 	 }
 
开发者ID:lindenb,项目名称:knime4bio,代码行数:25,代码来源:AggregationNodeModel.java

示例8: execute

import org.knime.core.data.RowKey; //导入依赖的package包/类
@Override
protected BufferedDataTable[] execute(final BufferedDataTable[] inData,
                                      final ExecutionContext exec) throws Exception {
	// Create data cells.
    final DataTableSpec outSpecs = configure(new DataTableSpec[]{null})[0];
	int numCols = outSpecs.getNumColumns();
	DataCell[][] stringCells = new DataCell[1][numCols];
	// Build a table of string values.
	DataColumnSpec[] stringColSpecs = new DataColumnSpec[numCols];
	for (int i=0; i<numCols; i++) {
		StringCell sCell = new StringCell(this.colValues.get(i));
		stringCells[0][i] = sCell;
		stringColSpecs[i] = new DataColumnSpecCreator(colNames.get(i), StringCell.TYPE).createSpec();
	}
	DataRow row = new DefaultRow(new RowKey("0"), stringCells[0]);
	BufferedDataContainer cnt = exec.createDataContainer(new DataTableSpec(stringColSpecs));
	cnt.addRowToTable(row);
	cnt.close();
	BufferedDataTable bufTbl = exec.createBufferedDataTable(cnt.getTable(), exec);
	// Now, convert to the proper column types as configured by the input columns.
	BufferedDataTable out = exec.createSpecReplacerTable(bufTbl, outSpecs);
	return new BufferedDataTable[]{out};
}
 
开发者ID:helixyte,项目名称:knime_atc,代码行数:24,代码来源:ATCNodeModel.java

示例9: setClass

import org.knime.core.data.RowKey; //导入依赖的package包/类
/**
 * Set the class of a row
 *
 * @param rowkey
 *            the rowkey
 * @param classValue
 */
public void setClass(final RowKey rowkey, final String classValue) {
    m_classMap.put(rowkey, classValue);

    // if (getAllRowsLabeled()) {
    notifyAllRowsLabled();
    // } else {
    // notifyRowsStillUnlabeled();
    // }
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:17,代码来源:ActiveLearnLoopEndNodeViewListener.java

示例10: valueChanged

import org.knime.core.data.RowKey; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void valueChanged(final ListSelectionEvent e) {

    if (m_gui == null) {
        return; // If this happens after the view was closed once or more,
        // the memleak is still there! (shouldn't happen though)
    }
    final Object source = e.getSource();

    if ((source == m_gui.m_hiliteTable.getSelectionModel())
            && e.getValueIsAdjusting()) { // table row Selection Event

        // If nothing is selected we'll try to select first row in table
        if (m_gui.m_hiliteTable.getSelectedRow() < 0) {
            m_gui.m_hiliteTable.changeSelection(0, 0, false, false);
        }

        // if something was selected, we can update detailed view and
        // classBox
        if (m_gui.m_hiliteTable.getSelectedRow() > -1) {
            final RowKey selected = getSelectedRowKey();
            updateDetailedView(selected); // update detailed view with
            // selected RowKey

            if (m_gui.m_hiliteTable.getSelectedRowCount() > 1) {
                m_gui.m_classBox.setSelectedItem(null);
                m_gui.m_classBox.repaint();
            } else {
                // set class box value to class of now selected row
                m_gui.m_classBox.setSelectedItem(m_classMap.get(selected));
                m_gui.m_classBox.repaint();
            }
        }
        return;
    }

}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:41,代码来源:ActiveLearnLoopEndNodeViewListener.java

示例11: prepareNextIteration

import org.knime.core.data.RowKey; //导入依赖的package包/类
private void prepareNextIteration() {
    m_classMap = new HashMap<RowKey, String>(); // make a new hiliteMap

    // Add the hilites to our hiliteMap
    for (final RowKey key : m_nodeModel.getRowMap().keySet()) {
        m_classMap.put(key, ClassModel.NO_CLASS);
        // add all the keys, but without an value
    }
    m_curRow = 0;
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:11,代码来源:ActiveLearnLoopEndNodeViewListener.java

示例12: updateGUI

import org.knime.core.data.RowKey; //导入依赖的package包/类
private void updateGUI() {
    if (m_gui == null) {
        return;
    }

    if (m_nodeModel.getNodeState() != NodeModelState.SUSPENDED) {
        return; // only update GUI while in SUSPENDED state
    }

    if (m_classMap.size() > 0) {
        if (m_classMap.containsValue(ClassModel.NO_CLASS)) {
            notifyRowsStillUnlabeled();
        }

        updateViewerTable(); // update the Viewer Table
        updateDetailedView(getSelectedRowKey()); // update with first value
    }

    if (m_defaultClassModel.isActive()) {
        m_gui.m_classBtnList
                .setDefaultText(m_defaultClassModel.getStringValue());
    } else {
        m_gui.m_classBtnList.setDefaultText("- Skip -");
    }

    final RowKey key = m_classViewerTable.getRowKeyOf(m_curRow);
    if (key != null) {
        updateRowStatsLabel(key);
        m_gui.m_iterLbl.setText("Current Iteration: "
                + m_nodeModel.getCurrentIterationIndex());
    }
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:33,代码来源:ActiveLearnLoopEndNodeViewListener.java

示例13: updateDetailedView

import org.knime.core.data.RowKey; //导入依赖的package包/类
private void updateDetailedView(final RowKey selectedValue) {
    m_gui.m_detailedView.removeAll();

    if (selectedValue != null) {

        m_gui.m_detailedView
                .add(m_nodeModel.requireRenderer(selectedValue));
        m_gui.m_detailedView.repaint();
        m_gui.updateUI();
    }
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:12,代码来源:ActiveLearnLoopEndNodeViewListener.java

示例14: updateRowStatsLabel

import org.knime.core.data.RowKey; //导入依赖的package包/类
private void updateRowStatsLabel(final RowKey rowKey) {
    int numUnlabeled = 0;

    for (final String cls : m_classMap.values()) {
        if (cls.equals(ClassModel.NO_CLASS)) {
            numUnlabeled++;
        }
    }

    m_gui.m_rowStatsWiz.setText("Number of unlabeled rows: " + numUnlabeled
            + ", current row: " + rowKey.toString());
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:13,代码来源:ActiveLearnLoopEndNodeViewListener.java

示例15: resetAllWithClass

import org.knime.core.data.RowKey; //导入依赖的package包/类
private void resetAllWithClass(final String selClass) {
    for (final RowKey row : m_classMap.keySet()) {
        if (m_classMap.get(row).equals(selClass)) {
            setClass(row, ClassModel.NO_CLASS);
        }
    }
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:8,代码来源:ActiveLearnLoopEndNodeViewListener.java


注:本文中的org.knime.core.data.RowKey类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。