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


Java FlowVariable.Type方法代码示例

本文整理汇总了Java中org.knime.core.node.workflow.FlowVariable.Type方法的典型用法代码示例。如果您正苦于以下问题:Java FlowVariable.Type方法的具体用法?Java FlowVariable.Type怎么用?Java FlowVariable.Type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.knime.core.node.workflow.FlowVariable的用法示例。


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

示例1: getFieldReadStatement

import org.knime.core.node.workflow.FlowVariable; //导入方法依赖的package包/类
/**
 * Get a statement to inserted in the document of a java snippet to read
 * the given flow variable.
 * @param v the flow variable to be read
 * @return the statement
 */
@SuppressWarnings("rawtypes")
public String getFieldReadStatement(final FlowVariable v) {
    FieldsTableModel model =
        (FieldsTableModel) m_inFieldsTable.getTable().getModel();
    int index = -1;
    for (int r = 0; r < model.getRowCount(); r++) {
        Object value = model.getValueAt(r, Column.COLUMN);
        if (value instanceof FlowVariable) {
            FlowVariable foo = (FlowVariable)value;
            if (foo.getName().equals(v.getName())) {
                index = r;
                break;
            }
        }
    }

    if (index >= 0) {
        // return java field name
        return (String)model.getValueAt(index, Column.JAVA_FIELD);
    } else {
        // try to add a row for the flow variable
        boolean success = m_inFieldsTable.addRow(v);
        if (success) {
            TableModel tableModel = m_inFieldsTable.getTable().getModel();
            m_inFieldsTable.firePropertyChange(
                    InFieldsTable.PROP_FIELD_ADDED,
                    tableModel.getRowCount() - 1 ,
                    tableModel.getRowCount());
            // return java field name
            return (String)model.getValueAt(model.getRowCount() - 1,
                    Column.JAVA_FIELD);
        } else {
            // return generic code
            String name = v.getName();
            FlowVariable.Type type = v.getType();
            Class javaType = TypeProvider.getDefault().
                getTypeConverter(type).getPreferredJavaType();
            return "getFlowVariable(\"" + name + "\", "
                + Type.getIdentifierFor(javaType) + ")";
        }
    }
}
 
开发者ID:pavloff-de,项目名称:spark4knime,代码行数:49,代码来源:JSnippetFieldsController.java

示例2: TypeListCellRender

import org.knime.core.node.workflow.FlowVariable; //导入方法依赖的package包/类
public TypeListCellRender() {
    m_flowVars = new HashMap<FlowVariable.Type, FlowVariable>();
    m_flowVars.put(FlowVariable.Type.DOUBLE, new FlowVariable("double", 1.0));
    m_flowVars.put(FlowVariable.Type.INTEGER, new FlowVariable("int", 1));
    m_flowVars.put(FlowVariable.Type.STRING, new FlowVariable("string", "1.0"));
}
 
开发者ID:pavloff-de,项目名称:spark4knime,代码行数:7,代码来源:AddOutFieldDialog.java

示例3: InputListCellRenderer

import org.knime.core.node.workflow.FlowVariable; //导入方法依赖的package包/类
public InputListCellRenderer() {
    m_flowVars = new HashMap<FlowVariable.Type, FlowVariable>();
    m_flowVars.put(Type.DOUBLE, new FlowVariable("double", 1.0));
    m_flowVars.put(Type.INTEGER, new FlowVariable("int", 1));
    m_flowVars.put(Type.STRING, new FlowVariable("string", "1.0"));
}
 
开发者ID:pavloff-de,项目名称:spark4knime,代码行数:7,代码来源:OutFieldsTable.java

示例4: DataTypeTableCellRenderer

import org.knime.core.node.workflow.FlowVariable; //导入方法依赖的package包/类
public DataTypeTableCellRenderer() {
    m_flowVars = new HashMap<FlowVariable.Type, FlowVariable>();
    m_flowVars.put(Type.DOUBLE, new FlowVariable("double", 1.0));
    m_flowVars.put(Type.INTEGER, new FlowVariable("int", 1));
    m_flowVars.put(Type.STRING, new FlowVariable("string", "1.0"));
}
 
开发者ID:pavloff-de,项目名称:spark4knime,代码行数:7,代码来源:OutFieldsTable.java


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