本文整理汇总了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;
}
示例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;
}
示例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;
}