Examples of convertToNumber()


Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    final Type lengthType = parameters.getType(2);
    final Object lengthValue = parameters.getValue(2);

    final Sequence text = new RecursiveSequence(textValue, context);
    final Number start = typeRegistry.convertToNumber(startType, startValue);
    final Number length = typeRegistry.convertToNumber(lengthType, lengthValue);

    if (length.doubleValue() < 0 || start.doubleValue() < 1)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

   
    if (type.isFlagSet(Type.NUMERIC_TYPE))
    {
      final TypeRegistry typeRegistry = context.getTypeRegistry();
      // return the same as zero minus value.
      final Number number = typeRegistry.convertToNumber(type, val);
      if (number == null)
      {
        throw EvaluationException.getInstance
            (LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
      }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    }
    int indexFrom = 0;

    if (indexType != null)
    {
      final Number n = typeRegistry.convertToNumber(indexType, indexValue);
      if (n.intValue() >= 1)
      {
        indexFrom = n.intValue() - 1;
      }
      else
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    final int length;
    if (parameterCount == 2)
    {
      final Type lengthType = parameters.getType(1);
      final Object lengthValue = parameters.getValue(1);
      final Number lengthConv = typeRegistry.convertToNumber(lengthType, lengthValue);
      if (lengthConv.doubleValue() < 0)
      {
        throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
      }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    // Instead of replacing all occurences, the user only requested to replace
    // a specific one.
    final Type whichType = parameters.getType(3);
    final Object whichValue = parameters.getValue(3);
    final Number n = typeRegistry.convertToNumber(whichType, whichValue);
    if (n.doubleValue() < 1)
    {
      throw EvaluationException.getInstance(
          LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    final TypeRegistry typeRegistry = context.getTypeRegistry();

    final Type countType = parameters.getType(1);
    final Object countValue = parameters.getValue(1);

    final int count = typeRegistry.convertToNumber(countType, countValue).intValue();
    if (count < 0)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    final Type lengthType = parameters.getType(2);
    final Object lengthValue = parameters.getValue(2);

    final String newText = typeRegistry.convertToText(newTextType, newTextValue);
    final String text = typeRegistry.convertToText(textType, textValue);
    final Number start = typeRegistry.convertToNumber(startType, startValue);
    if (start.intValue() <= 0)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
    }
    final Number length = typeRegistry.convertToNumber(lengthType, lengthValue);
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    final Number start = typeRegistry.convertToNumber(startType, startValue);
    if (start.intValue() <= 0)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
    }
    final Number length = typeRegistry.convertToNumber(lengthType, lengthValue);
    if (length.intValue() < 0)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
    }

    final TypeRegistry typeRegistry = context.getTypeRegistry();
    final Number n = typeRegistry.convertToNumber(parameters.getType(0), parameters.getValue(0));

    if (n == null)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    final Type type1 = parameters.getType(0);
    final Object value = parameters.getValue(0);

    final TypeRegistry typeRegistry = context.getTypeRegistry();
    final Number number = typeRegistry.convertToNumber(type1, value);

    if (number == null)
    {
      throw EvaluationException.getInstance(
          LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.