Examples of TypeValuePair


Examples of org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair

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

    return new TypeValuePair(TextType.TYPE, process(text, start.intValue(), length.intValue()));
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair

    public TypeValuePair evaluate(FormulaContext context, ParameterCallback parameters) throws EvaluationException {
        final int parameterCount = parameters.getParameterCount();
        if (parameterCount > 0) {
            throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
        }
        return new TypeValuePair(NumberType.GENERIC_NUMBER, PI_VALUE);
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair

    final Object o = context.resolveReference(text);
    if (o == null)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_NA_VALUE);
    }
    return new TypeValuePair(t, o);
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair

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

    return new TypeValuePair(AnyType.ANY_ARRAY, process(text, start.intValue(), length.intValue()));
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair

        }
        final double d = result.doubleValue();
        if ( d < -1.0 || d > 1.0 ) {
            throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
        }
        return new TypeValuePair(NumberType.GENERIC_NUMBER, new BigDecimal(Math.acos(d)));
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair

      throws EvaluationException
  {
    final Date yesterday = yesterday(context);

    final Date date = DateUtil.normalizeDate(yesterday, DateTimeType.DATE_TYPE);
    return new TypeValuePair(DateTimeType.DATE_TYPE, date);
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair

    if (result == null)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
    }

    return new TypeValuePair(TextType.TYPE, capitalize(result));
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair

        final Sequence sequence = new RecursiveSequence(value, context);

        while (sequence.hasNext())
        {
          final Object o = sequence.next();
          needles.add(new TypeValuePair(AnyType.TYPE, o));
        }
      }
      catch (EvaluationException e)
      {
        if (e.getErrorValue() == LibFormulaErrorValue.ERROR_NA_VALUE)
        {
          needles.add(new TypeValuePair(AnyType.TYPE, null));
        }
        else
        {
          throw e;
        }
      }
    }

    if (needles.size() == 0)
    {
      return new TypeValuePair(LogicalType.TYPE, Boolean.TRUE);
    }


    final Object value = parameters.getValue(0);
    final Sequence sequence = new RecursiveSequence(value, context);
    final EqualOperator equalOperator = new EqualOperator();

    while (sequence.hasNext())
    {
      final Object o = sequence.next();
      final TypeValuePair sequenceValue = new TypeValuePair(AnyType.TYPE, o);
      for (int i = needles.size() - 1; i >= 0; i -= 1)
      {
        final TypeValuePair needle = needles.get(i);
        if (needle.getValue() == o)
        {
          needles.remove(i);
        }
        else if (o != null)
        {
          final TypeValuePair evaluate = equalOperator.evaluate(context, sequenceValue, needle);
          if (Boolean.TRUE.equals(evaluate.getValue()))
          {
            needles.remove(i);
          }
        }
      }
    }

    return new TypeValuePair(LogicalType.TYPE, needles.isEmpty());
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair

        // This is in case of an error value in a scalar argument, we must ignore this error in number sequences
        // todo: maybe it has to be done for other type of exceptions.
      }
    }

    return new TypeValuePair(NumberType.GENERIC_NUMBER, new BigDecimal(count));
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair

    }
    final Type type1 = parameters.getType(0);
    final Object value1 = parameters.getValue(0);
    final Number result = context.getTypeRegistry().convertToNumber(type1, value1);
   
    return new TypeValuePair(NumberType.GENERIC_NUMBER, compute(result));
  }
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.