本文整理汇总了Java中org.pentaho.di.core.row.ValueMetaInterface.getInteger方法的典型用法代码示例。如果您正苦于以下问题:Java ValueMetaInterface.getInteger方法的具体用法?Java ValueMetaInterface.getInteger怎么用?Java ValueMetaInterface.getInteger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.row.ValueMetaInterface
的用法示例。
在下文中一共展示了ValueMetaInterface.getInteger方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPrimitive
import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public static Object getPrimitive(ValueMetaInterface valueMeta, Object valueData) throws KettleValueException
{
switch(valueMeta.getType())
{
case ValueMetaInterface.TYPE_BIGNUMBER: return valueMeta.getBigNumber(valueData);
case ValueMetaInterface.TYPE_BINARY: return valueMeta.getBinary(valueData);
case ValueMetaInterface.TYPE_BOOLEAN: return valueMeta.getBoolean(valueData);
case ValueMetaInterface.TYPE_DATE: return valueMeta.getDate(valueData);
case ValueMetaInterface.TYPE_INTEGER: valueMeta.getInteger(valueData);
case ValueMetaInterface.TYPE_NUMBER: return valueMeta.getNumber(valueData);
// case ValueMetaInterface.TYPE_SERIALIZABLE: return valueMeta.(valueData);
case ValueMetaInterface.TYPE_STRING: return valueMeta.getString(valueData);
default: return null;
}
}
示例2: createObjectsForRow
import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public static Object[] createObjectsForRow(RowMetaInterface rowMeta, Object[] rowData) throws KettleValueException
{
Object[] values = new Object[rowMeta.size()];
for (int i=0;i<rowMeta.size();i++)
{
ValueMetaInterface valueMeta = rowMeta.getValueMeta(i);
Object valueData = rowData[i];
int length = valueMeta.getLength();
switch(valueMeta.getType())
{
case ValueMetaInterface.TYPE_INTEGER:
if (length<3)
{
values[i] = new Byte( valueMeta.getInteger(valueData).byteValue() );
}
else
{
if (length<5)
{
values[i] = new Short(valueMeta.getInteger(valueData).shortValue());
}
else
{
values[i] = valueMeta.getInteger(valueData);
}
}
break;
case ValueMetaInterface.TYPE_NUMBER:
values[i] = valueMeta.getNumber(valueData);
break;
case ValueMetaInterface.TYPE_DATE:
values[i] = valueMeta.getDate(valueData);
break;
case ValueMetaInterface.TYPE_STRING:
values[i] = valueMeta.getString(valueData);
break;
case ValueMetaInterface.TYPE_BINARY:
values[i] = valueMeta.getBinary(valueData);
break;
case ValueMetaInterface.TYPE_BOOLEAN:
values[i] = valueMeta.getBoolean(valueData);
break;
case ValueMetaInterface.TYPE_BIGNUMBER:
values[i] = valueMeta.getNumber(valueData);
break;
default: break;
}
}
return values;
}
示例3: createObjectsForRow
import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public static Object[] createObjectsForRow(RowMetaInterface rowMeta, Object[] rowData) throws KettleValueException
{
Object[] values = new Object[rowMeta.size()];
for (int i=0;i<rowMeta.size();i++)
{
ValueMetaInterface valueMeta = rowMeta.getValueMeta(i);
Object valueData = rowData[i];
// Prevent a NullPointerException below
if (valueData == null || valueMeta == null)
{
values[i] = null;
continue;
}
int length = valueMeta.getLength();
switch(valueMeta.getType())
{
case ValueMetaInterface.TYPE_INTEGER:
if (length<3)
{
values[i] = new Byte( valueMeta.getInteger(valueData).byteValue() );
}
else
{
if (length<5)
{
values[i] = new Short(valueMeta.getInteger(valueData).shortValue());
}
else
{
values[i] = valueMeta.getInteger(valueData);
}
}
break;
case ValueMetaInterface.TYPE_NUMBER:
values[i] = valueMeta.getNumber(valueData);
break;
case ValueMetaInterface.TYPE_DATE:
values[i] = valueMeta.getDate(valueData);
break;
case ValueMetaInterface.TYPE_STRING:
values[i] = valueMeta.getString(valueData);
break;
case ValueMetaInterface.TYPE_BINARY:
values[i] = valueMeta.getBinary(valueData);
break;
case ValueMetaInterface.TYPE_BOOLEAN:
values[i] = valueMeta.getBoolean(valueData);
break;
case ValueMetaInterface.TYPE_BIGNUMBER:
values[i] = valueMeta.getNumber(valueData);
break;
default: break;
}
}
return values;
}