• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java RowKey类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: requireRenderer

import org.knime.core.data.RowKey; //导入依赖的package包/类
/**
 * Get renderer of data referenced by RowKey parameter.
 *
 * @param key
 *            the key of the desired row
 * @return Component which represents a renderer for the data referenced by
 *         key
 */
public Component requireRenderer(final RowKey key) {
    final DataRow dataRow = m_rowMap.get(key);
    if (dataRow == null) {
        throw new IllegalStateException();
    }
    final DataCell cell = dataRow.getCell(m_repColIdx);
    return m_renderer.getRendererComponent(cell);
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:17,代码来源:ActiveLearnLoopEndNodeModel.java


示例17: updateEntries

import org.knime.core.data.RowKey; //导入依赖的package包/类
/**
 * Update the tables entries with a set of keys.
 *
 * @param keys
 *            the
 * @param dataMap
 * @param columnNames
 */
public void updateEntries(final Set<RowKey> keys,
        final Map<RowKey, DataRow> dataMap, final String[] columnNames) {
    if ((keys == null) || (dataMap == null)) {
        return;
    }

    // one extra for row key
    m_columnNames = new String[columnNames.length + 1];
    m_columnNames[0] = "RowID";

    for (int i = 0; i < columnNames.length; i++) {
        m_columnNames[i + 1] = columnNames[i];
    }

    // FIXME: UGLY UGLY CODE
    for (final RowKey rowKey : dataMap.keySet()) {
        if (keys.contains(rowKey)) {
            boolean alreadyExists = false;
            for (final DataRow dataRow : m_rows) {
                if (dataRow.getKey() == rowKey) {
                    alreadyExists = true;
                    break;
                }
            }
            if (!alreadyExists) {
                m_rows.add(dataMap.get(rowKey));
            }
        }
    }

    fireTableStructureChanged(); // notify to redraw everything
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:41,代码来源:ClassViewerTable.java


示例18: getRowKeyOf

import org.knime.core.data.RowKey; //导入依赖的package包/类
/**
 * Returns the RowKey of the given row index
 *
 * @param row
 * @return the RowKey of the row'th row
 */
public RowKey getRowKeyOf(final int row) {
    if ((row >= m_rows.size()) || (row < 0)) {
        return null; // Out of bounds
    }
    return m_rows.get(row).getKey();
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:13,代码来源:ClassViewerTable.java


示例19: execute

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

    final int currentIteration = getAvailableFlowVariables()
            .get(ActiveLearnLoopUtils.AL_STEP).getIntValue();

    // cache the rowkey to class mapping.
    if (currentIteration == 0) {
        initializeClassMap(inData);
    }

    exec.setProgress("Processing ...");

    m_newClassesMap = new HashMap<RowKey, String>();
    if ((currentIteration < (m_maxIterationsModel.getIntValue()))
            && (inData[UNLABELED_PORT].size() > 0)) {

        // Lookup class labels
        inData[UNLABELED_PORT].forEach((row) -> {
            final RowKey rowKey = row.getKey();
            m_newClassesMap.put(rowKey, m_allClassesMap.get(rowKey));
        });
        super.continueLoop();
        return null;
    } else {
        // return an empty table when the optional input is not connected
        if (inData[PASSTHROUGH_PORT] == null) {
            final BufferedDataContainer paddContainer = exec
                    .createDataContainer(inData[UNLABELED_PORT].getSpec());
            paddContainer.close();
            return new BufferedDataTable[] { paddContainer.getTable() };
        }
        return new BufferedDataTable[] { inData[PASSTHROUGH_PORT] };
    }
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:40,代码来源:DBGActiveLearnLoopEndNodeModel.java


示例20: 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("Potential", DoubleCell.TYPE)
                            .createSpec(),
                    new DataColumnSpecCreator("Entropy", DoubleCell.TYPE)
                            .createSpec(),
                    new DataColumnSpecCreator("Score", DoubleCell.TYPE)
                            .createSpec() };
        }

        @Override
        public DataCell[] getCells(final DataRow row) {
            return new DataCell[] {
                    new DoubleCell(
                            m_dataPoints.get(row.getKey()).getPotential()),
                    new DoubleCell(
                            m_dataPoints.get(row.getKey()).getEntropy()),
                    new DoubleCell(
                            m_dataPoints.get(row.getKey()).getScore()) };
        }
    });

    return rearranger;
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:37,代码来源:PBACScorerNodeModel.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ICrashReportDetail类代码示例发布时间:2022-05-23
下一篇:
Java EditableWSDLPort类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap