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


Java LValue类代码示例

本文整理汇总了Java中org.pentaho.reporting.libraries.formula.lvalues.LValue的典型用法代码示例。如果您正苦于以下问题:Java LValue类的具体用法?Java LValue怎么用?Java LValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LValue类属于org.pentaho.reporting.libraries.formula.lvalues包,在下文中一共展示了LValue类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testTimestampType

import org.pentaho.reporting.libraries.formula.lvalues.LValue; //导入依赖的package包/类
@Test
public void testTimestampType() throws PentahoMetadataException {
  Timestamp timestamp = new Timestamp( 0 );
  Calendar calendar = Calendar.getInstance( Locale.getDefault() );
  calendar.setTime( timestamp );
  SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss", Locale.getDefault() );
  String expected = '\'' + sdf.format( calendar.getTime() ) + '.' + calendar.get( Calendar.MILLISECOND ) + '\'';
  FormulaTraversalInterface formula = mock( FormulaTraversalInterface.class );
  LValue[] values = new LValue[] { new StaticValue( timestamp ) };
  FormulaFunction formulaFunction = mock( FormulaFunction.class );
  when( formulaFunction.getChildValues() ).thenReturn( values );
  StringBuffer sb = new StringBuffer();
  SQLDialectInterface dialect = new DefaultSQLDialect();
  SQLFunctionGeneratorInterface generator = dialect.getFunctionSQLGenerator( "DATEVALUE" );
  generator.generateFunctionSQL( formula, sb, Locale.getDefault().toString(), formulaFunction );
  assertEquals( expected, sb.toString() );
}
 
开发者ID:pentaho,项目名称:pentaho-metadata,代码行数:18,代码来源:DefaultSQLDialectIT.java

示例2: getRaw

import org.pentaho.reporting.libraries.formula.lvalues.LValue; //导入依赖的package包/类
public LValue getRaw(final int row, final int column) throws EvaluationException
{
  if (column == 0)
  {
    final ContextLookup lookup = new ContextLookup("." + firstColumnName + (firstRow + row));
    lookup.initialize(TestFormulaContext.this);
    return lookup;
  }
  return null;
}
 
开发者ID:tmorgner,项目名称:pentaho-reporting-oem-sdk,代码行数:11,代码来源:TestFormulaContext.java

示例3: getRaw

import org.pentaho.reporting.libraries.formula.lvalues.LValue; //导入依赖的package包/类
@Override
public LValue getRaw( int position ) {
  return values[position];
}
 
开发者ID:pentaho,项目名称:pentaho-metadata,代码行数:5,代码来源:FunctionsTest.java


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