Examples of Formula


Examples of org.hibernate.mapping.Formula

      }
      Iterator columns = sourceValue.getColumnIterator();
      Random random = new Random();
      while ( columns.hasNext() ) {
        Object current = columns.next();
        Formula formula = new Formula();
        String formulaString;
        if ( current instanceof Column ) {
          formulaString = ( (Column) current ).getQuotedName();
        }
        else if ( current instanceof Formula ) {
          formulaString = ( (Formula) current ).getFormula();
        }
        else {
          throw new AssertionFailure( "Unknown element in column iterator: " + current.getClass() );
        }
        if ( fromAndWhere != null ) {
          formulaString = Template.renderWhereStringTemplate( formulaString, "$alias$", new HSQLDialect() );
          formulaString = "(select " + formulaString + fromAndWhere + ")";
          formulaString = StringHelper.replace(
              formulaString,
              "$alias$",
              "a" + random.nextInt( 16 )
          );
        }
        formula.setFormula( formulaString );
        targetValue.addFormula( formula );

      }
      return targetValue;
    }
View Full Code Here

Examples of org.jfree.formula.Formula

  {
    try
    {
      final FormattedTextElement element = (FormattedTextElement) getNode();
      final FormulaExpression formulaExpression = element.getValueExpression();
      final Formula formula = formulaExpression.getCompiledFormula();
      final LValue lValue = formula.getRootReference();
      return isReferenceChanged(lValue);
    }
    catch (final ParseException e)
    {
      Log.debug("Parse Exception", e);
View Full Code Here

Examples of org.mizartools.dli.Formula

    VariableId vid2 = new VariableId();
    vid2.setId(vid.getId());
    for (org.mizartools.system.xml.PartialDef partialDef : defMeaning.getPartialDefList()){
      partList.add(getPart(abstractSignature, partialDef, vid2));
    }
    Formula formula = getFormula(abstractSignature, defMeaning.getFormula(), vid2);
    Term term = getTerm(abstractSignature, defMeaning.getTerm(), vid2);
    ProperDefiniens properDefiniens = new ProperDefiniens(partList , formula, term);
    return properDefiniens;
  }
View Full Code Here

Examples of org.openntf.domino.helpers.Formula

  }

  @Override
  public void run() {
    Session session = this.getSession();
    Formula formula = new Formula();
    String source = "REM {Begin_Do_Not_Tag};\r\n" + "\r\n" + "SenderName := @If(SendTo = \"\";EnterSendTo;SendTo);\r\n"
        + "Send := @Subset(SenderName; 1);\r\n" + "CN1 := @Trim(@Name([CN]; Send));\r\n"
        + "CN := @If(@Contains(@Right(Send;\"@\");\">\") & CN1 = \"\";@Trim(Send); CN1);\r\n"
        + "G := @If(CN = \"\"; @Name([G]; @Subset(SenderName; 1)); \"\");\r\n"
        + "S := @If(CN = \"\"; @Name([S]; @Subset(SenderName; 1)); \"\");\r\n"
        + "Person := @If(CN != \"\"; CN; G + \" \" + S);\r\n"
        + "@If(@Left(Person;1)=\"\\\"\" & @Right(Person;1)=\"\\\"\"; @LeftBack(@RightBack(Person;1);1); Person);\r\n"
        + "REM {End_Do_Not_Tag};";
    formula.setExpression(source);
    org.openntf.domino.helpers.Formula.Parser parser = formula.getParser();
    if (parser != null) {
      parser.parse();
      Set<String> literals = parser.getLiterals();
      System.out.println("BEGIN LITERALS");
      for (String literal : literals) {
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.Formula

                new DefaultTableModel(), -1, new DefaultProcessingContext());
      }


      final String formula = computeFormula(configIndicator);
      final Formula compiledFormula = new Formula(formula);
      compiledFormula.initialize(new ReportFormulaContext(formulaContext, expressionRuntime));
      final Object o = compiledFormula.evaluate();
      if (o instanceof ErrorValue)
      {
        throw EvaluationException.getInstance((ErrorValue) o);
      }
      if (o == null)
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.Formula

    try
    {
      if (compiledFormula == null)
      {
        compiledFormula = new Formula(formulaExpression);
      }

      final ExpressionRuntime expressionRuntime = getRuntime();

      final ReportFormulaContext context =
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.Formula

    try
    {
      if (initial != null)
      {
        final ExpressionRuntime expressionRuntime = getRuntime();
        final Formula initFormula = new Formula(initialExpression);
        final ReportFormulaContext context = new ReportFormulaContext
            (getFormulaContext(), expressionRuntime);
        try
        {
          initFormula.initialize(context);
          return initFormula.evaluate();
        }
        finally
        {
          context.close();
        }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.Formula

    try
    {
      if (compiledFormula == null)
      {
        compiledFormula = new Formula(formulaExpression);
      }
      final ExpressionRuntime expressionRuntime = getRuntime();
      final ReportFormulaContext context =
          new ReportFormulaContext(getFormulaContext(), expressionRuntime);
      try
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.Formula

      {
        errorTextHolder.setText(Messages.getInstance().getString("FormulaEditorDialog.ShortErrorNoFormulaContext"));
        errorTextHolder.setToolTipText(Messages.getInstance().getString("FormulaEditorDialog.ErrorNoFormulaContext"));
        return;
      }
      final Formula formula = new Formula(formulaText);
      formula.initialize(formulaContext);
      final TypeValuePair pair = formula.evaluateTyped();

      if (pair.getValue() instanceof LibFormulaErrorValue)
      {
        errorTextHolder.setText(Messages.getInstance().getString("FormulaEditorDialog.ShortEvaluationError"));
        errorTextHolder.setToolTipText(Messages.getInstance().getString("FormulaEditorDialog.EvaluationError"));
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.Formula

public class FormulaParsePosition
{
  public static void main(String[] args) throws EvaluationException, ParseException
  {
    final Formula f = new Formula("IF(NOT(TRUE()));\"Testing\"; \"Other\"");

    // connects the parsed formula to the context. The context provides the
    // operator and function implementations and resolves the references.
    f.initialize(new DefaultFormulaContext());

    final LValue rootReference = f.getRootReference();
    print(rootReference, 0);
  }
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.