本文整理汇总了Java中org.pentaho.di.core.row.value.ValueMetaNumber类的典型用法代码示例。如果您正苦于以下问题:Java ValueMetaNumber类的具体用法?Java ValueMetaNumber怎么用?Java ValueMetaNumber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValueMetaNumber类属于org.pentaho.di.core.row.value包,在下文中一共展示了ValueMetaNumber类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getValueMetaInterface
import org.pentaho.di.core.row.value.ValueMetaNumber; //导入依赖的package包/类
private ValueMetaInterface getValueMetaInterface( String fieldName, int fieldType ) {
switch ( fieldType ) {
case ValueMetaInterface.TYPE_INET:
return new ValueMetaInternetAddress( fieldName );
case ValueMetaInterface.TYPE_STRING:
return new ValueMetaString( fieldName );
case ValueMetaInterface.TYPE_INTEGER:
return new ValueMetaInteger( fieldName );
case ValueMetaInterface.TYPE_NUMBER:
return new ValueMetaNumber( fieldName );
case ValueMetaInterface.TYPE_BIGNUMBER:
return new ValueMetaBigNumber( fieldName );
case ValueMetaInterface.TYPE_TIMESTAMP:
return new ValueMetaTimestamp( fieldName );
case ValueMetaInterface.TYPE_DATE:
return new ValueMetaDate( fieldName );
case ValueMetaInterface.TYPE_BOOLEAN:
return new ValueMetaBoolean( fieldName );
case ValueMetaInterface.TYPE_BINARY:
return new ValueMetaBinary( fieldName );
}
return null;
}
示例2: createRowMetaInterface
import org.pentaho.di.core.row.value.ValueMetaNumber; //导入依赖的package包/类
public RowMetaInterface createRowMetaInterface() {
RowMetaInterface rm = new RowMeta();
ValueMetaInterface[] valuesMeta =
{
new ValueMetaString( "string" ),
new ValueMetaInteger( "integer" ),
new ValueMetaNumber( "number" ),
new ValueMetaBigNumber( "bigdecimal" ),
new ValueMetaDate( "date" ),
new ValueMetaBinary( "binary" ),
new ValueMetaBoolean( "bool" ),
new ValueMetaTimestamp( "timestamp" ),
new ValueMetaInternetAddress( "inetaddress" ), };
for ( int i = 0; i < valuesMeta.length; i++ ) {
rm.addValueMeta( valuesMeta[i] );
}
return rm;
}
示例3: createResultRowMetaInterface
import org.pentaho.di.core.row.value.ValueMetaNumber; //导入依赖的package包/类
public RowMetaInterface createResultRowMetaInterface() {
RowMetaInterface rm = new RowMeta();
ValueMetaInterface[] valuesMeta =
{
new ValueMetaString( "field1" ), new ValueMetaInteger( "field2" ),
new ValueMetaNumber( "field3" ), new ValueMetaBoolean( "field5" ),
new ValueMetaBigNumber( "field6" ),
new ValueMetaBoolean( "result" ), };
for ( int i = 0; i < valuesMeta.length; i++ ) {
rm.addValueMeta( valuesMeta[i] );
}
return rm;
}
示例4: createRowMetaInterface4
import org.pentaho.di.core.row.value.ValueMetaNumber; //导入依赖的package包/类
public RowMetaInterface createRowMetaInterface4() {
RowMetaInterface rm = new RowMeta();
ValueMetaInterface[] valuesMeta =
{
new ValueMetaInteger( "int_in" ),
new ValueMetaNumber( "number_in" ),
new ValueMetaString( "string_in" ), new ValueMetaInteger( "long1" ),
new ValueMetaNumber( "number1" ), new ValueMetaString( "string1" ),
new ValueMetaInteger( "long2" ), new ValueMetaNumber( "number2" ),
new ValueMetaString( "string2" ), };
for ( int i = 0; i < valuesMeta.length; i++ ) {
rm.addValueMeta( valuesMeta[ i ] );
}
return rm;
}
示例5: createRowMetaInterface
import org.pentaho.di.core.row.value.ValueMetaNumber; //导入依赖的package包/类
public RowMetaInterface createRowMetaInterface() {
RowMetaInterface rm = new RowMeta();
ValueMetaInterface[] valuesMeta =
{
new ValueMetaString( "field1" ), new ValueMetaInteger( "field2" ),
new ValueMetaNumber( "field3" ), new ValueMetaDate( "field4" ),
new ValueMetaBoolean( "field5" ),
new ValueMetaBigNumber( "field6" ),
new ValueMetaBigNumber( "field7" ) };
for ( int i = 0; i < valuesMeta.length; i++ ) {
rm.addValueMeta( valuesMeta[i] );
}
return rm;
}
示例6: testIsBlank_EmptyStringIsNotNull
import org.pentaho.di.core.row.value.ValueMetaNumber; //导入依赖的package包/类
@Test
public void testIsBlank_EmptyStringIsNotNull() throws KettleException {
FieldAccessorUtl.ensureEmptyStringIsNotNull( true );
final String fIsBlank = "ISBLANK([" + KEY_ARG + "])";
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "1" }, false );
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "a" }, false );
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { null }, true );
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "" }, false );
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { " " }, false );
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { 1 }, false );
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { 0 }, false );
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { -1.0 }, false );
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { null }, true );
}
示例7: testIsBlank_EmptyStringIsNull
import org.pentaho.di.core.row.value.ValueMetaNumber; //导入依赖的package包/类
@Test
public void testIsBlank_EmptyStringIsNull() throws KettleException {
FieldAccessorUtl.ensureEmptyStringIsNotNull( false );
final String fIsBlank = "ISBLANK([" + KEY_ARG + "])";
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "1" }, false );
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "a" }, false );
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { null }, true );
// assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "" }, true ); //
// TODO: Is it correct?
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "" }, false ); //
// TODO: Is it correct?
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { " " }, false );
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { 1 }, false );
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { 0 }, false );
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { -1.0 }, false );
assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { null }, true );
}
示例8: testIsText_EmptyStringIsNotNull
import org.pentaho.di.core.row.value.ValueMetaNumber; //导入依赖的package包/类
@Test
public void testIsText_EmptyStringIsNotNull() throws KettleException {
FieldAccessorUtl.ensureEmptyStringIsNotNull( true );
final String fIsText = "ISTEXT([" + KEY_ARG + "])";
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "1" }, true );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "a" }, true );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { null }, false );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "" }, true );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { " " }, true );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { 1 }, false );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { 0 }, false );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { -1.0 }, false );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { null }, false );
}
示例9: testIsText_EmptyStringIsNull
import org.pentaho.di.core.row.value.ValueMetaNumber; //导入依赖的package包/类
@Test
public void testIsText_EmptyStringIsNull() throws KettleException {
FieldAccessorUtl.ensureEmptyStringIsNotNull( false );
final String fIsText = "ISTEXT([" + KEY_ARG + "])";
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "1" }, true );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "a" }, true );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { null }, false );
// assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "" }, false ); //
// TODO: Is it correct?
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "" }, true ); //
// TODO: Is it correct?
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { " " }, true );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { 1 }, false );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { 0 }, false );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { -1.0 }, false );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { null }, false );
}
示例10: testIsNonText_EmptyStringIsNotNull
import org.pentaho.di.core.row.value.ValueMetaNumber; //导入依赖的package包/类
@Test
public void testIsNonText_EmptyStringIsNotNull() throws KettleException {
FieldAccessorUtl.ensureEmptyStringIsNotNull( true );
final String fIsText = "ISNONTEXT([" + KEY_ARG + "])";
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "1" }, false );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "a" }, false );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { null }, true );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "" }, false );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { " " }, false );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { 1 }, true );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { 0 }, true );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { -1.0 }, true );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { null }, true );
}
示例11: testIsNonText_EmptyStringIsNull
import org.pentaho.di.core.row.value.ValueMetaNumber; //导入依赖的package包/类
@Test
public void testIsNonText_EmptyStringIsNull() throws KettleException {
FieldAccessorUtl.ensureEmptyStringIsNotNull( false );
final String fIsText = "ISNONTEXT([" + KEY_ARG + "])";
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "1" }, false );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "a" }, false );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { null }, true );
// assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "" }, true ); //
// TODO: Is it correct?
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "" }, false ); //
// TODO: Is it correct?
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { " " }, false );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { 1 }, true );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { 0 }, true );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { -1.0 }, true );
assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaNumber( KEY_ARG ) ), new Object[] { null }, true );
}
示例12: getTestRowMetaAndData
import org.pentaho.di.core.row.value.ValueMetaNumber; //导入依赖的package包/类
List<RowMetaAndData> getTestRowMetaAndData( int count, Integer[] nulls ) {
List<RowMetaAndData> list = new ArrayList<RowMetaAndData>();
RowMetaInterface rm = new RowMeta();
rm.addValueMeta( new ValueMetaString( KEY1 ) );
rm.addValueMeta( new ValueMetaInteger( KEY2 ) );
rm.addValueMeta( new ValueMetaNumber( KEY3 ) );
rm.addValueMeta( new ValueMetaBigNumber( KEY4 ) );
Object[] row = new Object[4];
List<Integer> nullsList = Arrays.asList( nulls );
for ( int i = 0; i < count; i++ ) {
if ( nullsList.contains( i ) ) {
for ( int j = 0; j < row.length; j++ ) {
row[j] = null;
}
} else {
row[0] = "";
row[1] = 1L;
row[2] = 2.0;
row[3] = new BigDecimal( 3 );
}
list.add( new RowMetaAndData( rm, row ) );
}
return list;
}
示例13: createRowMetaInterface
import org.pentaho.di.core.row.value.ValueMetaNumber; //导入依赖的package包/类
public RowMetaInterface createRowMetaInterface() {
RowMetaInterface rm = new RowMeta();
ValueMetaInterface[] valuesMeta =
{
new ValueMetaString( "field1" ), new ValueMetaInteger( "field2" ),
new ValueMetaNumber( "field3" ), new ValueMetaDate( "field4" ),
new ValueMetaBoolean( "field5" ),
new ValueMetaBigNumber( "field6" ),
new ValueMetaBigNumber( "field7" ), };
for ( int i = 0; i < valuesMeta.length; i++ ) {
rm.addValueMeta( valuesMeta[i] );
}
return rm;
}
示例14: insertJobEntryAttribute
import org.pentaho.di.core.row.value.ValueMetaNumber; //导入依赖的package包/类
public synchronized ObjectId insertJobEntryAttribute( ObjectId id_job, ObjectId id_jobentry, long nr,
String code, double value_num, String value_str ) throws KettleException {
ObjectId id = getNextJobEntryAttributeID();
RowMetaAndData table = new RowMetaAndData();
//CHECKSTYLE:LineLength:OFF
table.addValue( new ValueMetaInteger( KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_ID_JOBENTRY_ATTRIBUTE ), id );
table.addValue( new ValueMetaInteger( KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_ID_JOB ), id_job );
table.addValue( new ValueMetaInteger( KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_ID_JOBENTRY ), id_jobentry );
table.addValue( new ValueMetaInteger( KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_NR ), new Long( nr ) );
table.addValue( new ValueMetaString( KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_CODE ), code );
table.addValue( new ValueMetaNumber( KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_VALUE_NUM ), new Double( value_num ) );
table.addValue( new ValueMetaString( KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_VALUE_STR ), value_str );
database.prepareInsert( table.getRowMeta(), KettleDatabaseRepository.TABLE_R_JOBENTRY_ATTRIBUTE );
database.setValuesInsert( table );
database.insertRow();
database.closeInsert();
return id;
}
示例15: createRowMetaInterface
import org.pentaho.di.core.row.value.ValueMetaNumber; //导入依赖的package包/类
private static RowMetaInterface createRowMetaInterface() {
RowMetaInterface rm = new RowMeta();
ValueMetaInterface[] valuesMeta =
{
new ValueMetaString( "field1" ), new ValueMetaInteger( "field2" ),
new ValueMetaNumber( "field3" ), new ValueMetaDate( "field4" ),
new ValueMetaBoolean( "field5" ),
new ValueMetaBigNumber( "field6" ),
new ValueMetaBigNumber( "field7" ) };
for ( ValueMetaInterface aValuesMeta : valuesMeta ) {
rm.addValueMeta( aValuesMeta );
}
return rm;
}