Package org.formulacompiler.compiler.internal.templates

Examples of org.formulacompiler.compiler.internal.templates.ExpressionTemplatesForNumbers


{
  private final ExpressionTemplatesForNumbers template;

  public InterpretedNumericType_Generated( NumericType _type, ComputationMode _mode, Environment _env ) {
    super( _type, _mode, _env );
    this.template = new ExpressionTemplatesForNumbers( _mode, _env );
  }
View Full Code Here


  }

  @Override
  public Object compute( Function _function, Object... _args ) throws InterpreterException
  {
    final ExpressionTemplatesForNumbers t = this.template;
    final int c = _args.length;
    switch (_function) {
      case CODE:
        if (1 == c ) {
          return t.fun_CODE( to_String( _args[ 0 ] ) );
        }
         break;
      case LEN:
        if (1 == c ) {
          return t.fun_LEN( to_String( _args[ 0 ] ) );
        }
         break;
      case EXACT:
        if (2 == c ) {
          return t.fun_EXACT( to_String( _args[ 0 ] ), to_String( _args[ 1 ] ) );
        }
         break;
      case SEARCH:
        if (2 == c ) {
          return t.fun_SEARCH( to_String( _args[ 0 ] ), to_String( _args[ 1 ] ) );
        }
        if (3 == c ) {
          return t.fun_SEARCH( to_String( _args[ 0 ] ), to_String( _args[ 1 ] ), to_int( _args[ 2 ] ) );
        }
         break;
      case FIND:
        if (2 == c ) {
          return t.fun_FIND( to_String( _args[ 0 ] ), to_String( _args[ 1 ] ) );
        }
        if (3 == c ) {
          return t.fun_FIND( to_String( _args[ 0 ] ), to_String( _args[ 1 ] ), to_int( _args[ 2 ] ) );
        }
         break;
      case ERROR:
        if (1 == c ) {
          return t.fun_ERROR( to_String( _args[ 0 ] ) );
        }
         break;
      case NA:
        if (0 == c ) {
          return t.fun_NA();
        }
         break;
    }
    return super.compute( _function, _args );
  }
View Full Code Here

TOP

Related Classes of org.formulacompiler.compiler.internal.templates.ExpressionTemplatesForNumbers

Copyright © 2018 www.massapicom. 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.