Package org.jfree.formula.typing

Examples of org.jfree.formula.typing.TypeRegistry.convertToNumber()


    {
      throw new EvaluationException(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
    }

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

    if (n == null)
    {
      throw new EvaluationException(
View Full Code Here


    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 new EvaluationException(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
      }
View Full Code Here

    // 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 new EvaluationException(
          LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
    }
View Full Code Here

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

    final String text1 = typeRegistry.convertToText(textType1, textValue1);
    final int count = typeRegistry.convertToNumber(countType, countValue).intValue();
    if(text1 == null && count >= 0)
    {
      throw new EvaluationException(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
    }
View Full Code Here

    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);
    final Number length = typeRegistry.convertToNumber(lengthType, lengthValue);
   
    final MidFunction function = new MidFunction();
    final String result1 = function.process(text, new Integer(1), new Integer(start.intValue() - 1));
    final String result2 = function.process(text,
View Full Code Here

    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);
    final Number length = typeRegistry.convertToNumber(lengthType, lengthValue);
   
    final MidFunction function = new MidFunction();
    final String result1 = function.process(text, new Integer(1), new Integer(start.intValue() - 1));
    final String result2 = function.process(text,
        new Integer(start.intValue() + length.intValue()), new Integer(text.length()));
View Full Code Here

      throw new EvaluationException(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
    }

    final TypeRegistry typeRegistry = context.getTypeRegistry();

    final Number n1 = typeRegistry.convertToNumber(parameters.getType(0),
        parameters.getValue(0));
    final Number n2 = typeRegistry.convertToNumber(parameters.getType(1),
        parameters.getValue(1));
    final Number n3 = typeRegistry.convertToNumber(parameters.getType(2),
        parameters.getValue(2));
View Full Code Here

    final TypeRegistry typeRegistry = context.getTypeRegistry();

    final Number n1 = typeRegistry.convertToNumber(parameters.getType(0),
        parameters.getValue(0));
    final Number n2 = typeRegistry.convertToNumber(parameters.getType(1),
        parameters.getValue(1));
    final Number n3 = typeRegistry.convertToNumber(parameters.getType(2),
        parameters.getValue(2));

    if (n1 == null || n2 == null || n3 == null)
View Full Code Here

    final Number n1 = typeRegistry.convertToNumber(parameters.getType(0),
        parameters.getValue(0));
    final Number n2 = typeRegistry.convertToNumber(parameters.getType(1),
        parameters.getValue(1));
    final Number n3 = typeRegistry.convertToNumber(parameters.getType(2),
        parameters.getValue(2));

    if (n1 == null || n2 == null || n3 == null)
    {
      throw new EvaluationException(
View Full Code Here

    final String text = typeRegistry.convertToText(textType, textValue);
    final int length;
    if(parameterCount == 2)
    {
      final Number lengthVal = typeRegistry.convertToNumber(parameters.getType(1), parameters.getValue(1));
      if (lengthVal.doubleValue() < 0)
      {
        throw new EvaluationException(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
      }
      length = lengthVal.intValue();
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.