本文整理汇总了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) + ")";
}
}
}
示例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"));
}
示例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"));
}
示例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"));
}