本文整理汇总了Java中org.knime.core.data.def.StringCell.TYPE属性的典型用法代码示例。如果您正苦于以下问题:Java StringCell.TYPE属性的具体用法?Java StringCell.TYPE怎么用?Java StringCell.TYPE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.knime.core.data.def.StringCell
的用法示例。
在下文中一共展示了StringCell.TYPE属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTypeOfElement
/**
* Find out type of element
*
* @param element
* @return <code>DataType</code> of element
*/
public static DataType getTypeOfElement(Object element) {
if (element instanceof Double) {
return DoubleCell.TYPE;
} else if (element instanceof Float) {
return DoubleCell.TYPE;
} else if (element instanceof String) {
return StringCell.TYPE;
} else if (element instanceof Integer) {
return IntCell.TYPE;
} else if (element instanceof Boolean) {
return BooleanCell.TYPE;
} else if (element instanceof Long) {
return LongCell.TYPE;
} else {
throw new UnsupportedOperationException("Class "
+ element.getClass().getName()
+ " is not supported for this operation");
}
}
示例2: getCellValue
/**
* Extract value from cell. Supported types: <code>String</code>,
* <code>Double</code>, <code>Integer</code>, <code>Long</code>,
* <code>Boolean</code>.
*
* @param cell
* <code>DataCell</code>
* @return <code>Object</code> saved in cell or null
*/
private Object getCellValue(DataCell cell) {
DataType type = cell.getType();
if (type == StringCell.TYPE) {
return ((StringCell) cell).getStringValue();
} else if (type == DoubleCell.TYPE) {
return ((DoubleCell) cell).getDoubleValue();
} else if (type == IntCell.TYPE) {
return ((IntCell) cell).getIntValue();
} else if (type == LongCell.TYPE) {
return ((LongCell) cell).getLongValue();
} else if (type == BooleanCell.TYPE) {
return ((BooleanCell) cell).getBooleanValue();
} else {
return null;
}
}
示例3: getDataType
public DataType getDataType() throws InvalidSettingsException
{
if(m_dataType.getStringValue().equals("Long"))
{
return LongCell.TYPE;
}
else if(m_dataType.getStringValue().equals("Integer"))
{
return IntCell.TYPE;
}
else if(m_dataType.getStringValue().equals("Double"))
{
return DoubleCell.TYPE;
}
else if(m_dataType.getStringValue().equals("Boolean"))
{
return BooleanCell.TYPE;
}
return StringCell.TYPE;
}
示例4: configure
@Override
protected DataTableSpec[] configure(DataTableSpec[] inSpecs)
throws InvalidSettingsException
{
if(inSpecs==null || inSpecs.length!=1)
{
throw new InvalidSettingsException("Expected one table");
}
findColumnIndex(inSpecs[0],m_colInfo.getStringValue());
DataTableSpec spec2=new DataTableSpec(
new String[]{m_flag.getStringValue()},
new DataType[]{StringCell.TYPE}
);
DataTableSpec dataTableSpec3=new DataTableSpec(inSpecs[0],spec2);
return new DataTableSpec[]{dataTableSpec3,dataTableSpec3};
}
示例5: toObject
private static Object toObject(DataCell cell)
{
if(cell==null || cell.isMissing()) return null;
if(cell.getType()==StringCell.TYPE)
{
return StringCell.class.cast(cell).getStringValue();
}
else if(cell.getType()==BooleanCell.TYPE)
{
return BooleanCell.class.cast(cell).getBooleanValue();
}
else if(cell.getType()==IntCell.TYPE)
{
return IntCell.class.cast(cell).getIntValue();
}
else if(cell.getType()==DoubleCell.TYPE)
{
return DoubleCell.class.cast(cell).getDoubleValue();
}
else if(cell.getType()==LongCell.TYPE)
{
return LongCell.class.cast(cell).getLongValue();
}
else
{
return cell.toString();
}
}
示例6: setDataTable
public synchronized void setDataTable(BufferedDataTable dataTable)
{
stop();
this.dataTable=dataTable;
if(this.dataTable==null)
{
this.rowCount=0;
this.colCount=0;
this.classes.clear();
this.headers.clear();
}
else
{
this.rowCount=this.dataTable.getRowCount();
this.colCount=this.dataTable.getDataTableSpec().getNumColumns();
this.classes.setSize(this.colCount);
this.headers.setSize(this.colCount);
for(int i=0;i< this.colCount;++i)
{
DataColumnSpec colspec=this.dataTable.getDataTableSpec().getColumnSpec(i);
this.headers.set(i, colspec.getName());
if(colspec.getType()==StringCell.TYPE)
{
this.classes.set(i,String.class);
}
else if(colspec.getType()==BooleanCell.TYPE)
{
this.classes.set(i,Boolean.class);
}
else if(colspec.getType()==IntCell.TYPE)
{
this.classes.set(i,Integer.class);
}
else if(colspec.getType()==DoubleCell.TYPE)
{
this.classes.set(i,Double.class);
}
else if(colspec.getType()==LongCell.TYPE)
{
this.classes.set(i,Long.class);
}
else
{
this.classes.set(i,String.class);
}
}
}
fireTableStructureChanged();
}
示例7: DataTypeColumnFilter
public DataTypeColumnFilter()
{
this.dataTypes=new DataType[]{StringCell.TYPE};
}