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


Java LibFormulaErrorValue.ERROR_ARITHMETIC_VALUE属性代码示例

本文整理汇总了Java中org.pentaho.reporting.libraries.formula.LibFormulaErrorValue.ERROR_ARITHMETIC_VALUE属性的典型用法代码示例。如果您正苦于以下问题:Java LibFormulaErrorValue.ERROR_ARITHMETIC_VALUE属性的具体用法?Java LibFormulaErrorValue.ERROR_ARITHMETIC_VALUE怎么用?Java LibFormulaErrorValue.ERROR_ARITHMETIC_VALUE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.pentaho.reporting.libraries.formula.LibFormulaErrorValue的用法示例。


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

示例1: resolveReference

/**
 * We return the content of a Value with the given name. We cache the position of the field indexes.
 *
 * @see org.jfree.formula.FormulaContext#resolveReference(java.lang.Object)
 */
public Object resolveReference( Object name ) throws EvaluationException {
  if ( name instanceof String ) {
    ValueMetaInterface valueMeta;
    Integer idx = valueIndexMap.get( name );
    if ( idx != null ) {
      valueMeta = rowMeta.getValueMeta( idx.intValue() );
    } else {
      int index = rowMeta.indexOfValue( (String) name );
      if ( index < 0 ) {
        ErrorValue errorValue = new LibFormulaErrorValue( LibFormulaErrorValue.ERROR_INVALID_ARGUMENT );
        throw new EvaluationException( errorValue );
      }
      valueMeta = rowMeta.getValueMeta( index );
      idx = new Integer( index );
      valueIndexMap.put( (String) name, idx );
    }
    Object valueData = rowData[idx];
    try {
      return getPrimitive( valueMeta, valueData );
    } catch ( KettleValueException e ) {
      throw new EvaluationException( LibFormulaErrorValue.ERROR_ARITHMETIC_VALUE );
    }
  }
  return null;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:30,代码来源:RowForumulaContext.java

示例2: resolveReference

/**
  * We return the content of a Value with the given name.  We cache the position of the field indexes. 
  * 
  * @see org.jfree.formula.FormulaContext#resolveReference(java.lang.Object)
  */
 public Object resolveReference(Object name) throws ContextEvaluationException
 {
     if(name instanceof String)
     {
         ValueMetaInterface valueMeta;
         Integer idx = (Integer) valueIndexMap.get(name);
         if (idx!=null)
         {
             valueMeta = rowMeta.getValueMeta(idx.intValue());
         }
         else
         {
             int index = rowMeta.indexOfValue((String) name);
             if (index<0)
             {
             	ErrorValue errorValue = new LibFormulaErrorValue(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT);
 				throw new ContextEvaluationException(errorValue);
             }
             valueMeta = rowMeta.getValueMeta(index);
             idx = new Integer(index);
             valueIndexMap.put((String)name, idx);
         }
         Object valueData = rowData[idx];
         try {
	return getPrimitive(valueMeta, valueData);
} catch (KettleValueException e) {
	throw new ContextEvaluationException(LibFormulaErrorValue.ERROR_ARITHMETIC_VALUE);
}
     }
     return null;
 }
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:36,代码来源:RowForumulaContext.java

示例3: resolveReference

/**
  * We return the content of a Value with the given name.  We cache the position of the field indexes. 
  * 
  * @see org.jfree.formula.FormulaContext#resolveReference(java.lang.Object)
  */
 public Object resolveReference(Object name) throws EvaluationException
 {
     if(name instanceof String)
     {
         ValueMetaInterface valueMeta;
         Integer idx = (Integer) valueIndexMap.get(name);
         if (idx!=null)
         {
             valueMeta = rowMeta.getValueMeta(idx.intValue());
         }
         else
         {
             int index = rowMeta.indexOfValue((String) name);
             if (index<0)
             {
             	ErrorValue errorValue = new LibFormulaErrorValue(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT);
 				throw new EvaluationException(errorValue);
             }
             valueMeta = rowMeta.getValueMeta(index);
             idx = new Integer(index);
             valueIndexMap.put((String)name, idx);
         }
         Object valueData = rowData[idx];
         try {
	return getPrimitive(valueMeta, valueData);
} catch (KettleValueException e) {
	throw new EvaluationException(LibFormulaErrorValue.ERROR_ARITHMETIC_VALUE);
}
     }
     return null;
 }
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:36,代码来源:RowForumulaContext.java


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