Package org.formulacompiler.runtime

Examples of org.formulacompiler.runtime.NotAvailableException


      for (Object arg : range.arguments()) {
        final Object elt = ((ExpressionNodeForConstantValue) arg).value();
        if (_lookup.equals( elt )) return iObj;
        iObj++;
      }
      throw new NotAvailableException();
    }
    else {
      final Comparable comp = (Comparable) _lookup;
      final int isToRightWhenComparesAs = (_type > 0) ? 1 : -1;
      final List<ExpressionNode> args = range.arguments();
      final int iLast = args.size() - 1;
      int iLeft = 0;
      int iRight = iLast;
      while (iLeft < iRight) {
        final int iMid = iLeft + ((iRight - iLeft) >> 1);
        final Object arg = args.get( iMid );
        final Object elt = ((ExpressionNodeForConstantValue) arg).value();
        final int compRes = comp.compareTo( elt );
        if (compRes == isToRightWhenComparesAs) iLeft = iMid + 1;
        else iRight = iMid;
      }
      if (iLeft <= iLast) {
        final Object arg = args.get( iLeft );
        final Object elt = ((ExpressionNodeForConstantValue) arg).value();
        final int compRes = comp.compareTo( elt );
        if (compRes == 0 || compRes == isToRightWhenComparesAs) return iLeft;
      }
      if (iLeft == 0) throw new NotAvailableException();
      return iLeft - 1;
    }
  }
View Full Code Here


    else {
      for (int i = 0; i < _xs.length; i++) {
        if (0 == _x.compareToIgnoreCase( _xs[ i ] )) return i + 1; // Excel is 1-based
      }
    }
    throw new NotAvailableException();
  }
View Full Code Here

    throw new FormulaException( _message );
  }

  public static void fun_NA()
  {
    throw new NotAvailableException();
  }
View Full Code Here

  public static int fun_MATCH_Exact( double _x, double[] _xs )
  {
    for (int i = 0; i < _xs.length; i++) {
      if (_x == _xs[ i ]) return i + 1; // Excel is 1-based
    }
    throw new NotAvailableException();
  }
View Full Code Here

  public static int fun_MATCH_Exact( long _x, long[] _xs )
  {
    for (int i = 0; i < _xs.length; i++) {
      if (_x == _xs[ i ]) return i + 1; // Excel is 1-based
    }
    throw new NotAvailableException();
  }
View Full Code Here

  public static int fun_MATCH_Exact( BigDecimal _x, BigDecimal[] _xs )
  {
    for (int i = 0; i < _xs.length; i++) {
      if (_x.equals( _xs[ i ] )) return i + 1; // Excel is 1-based
    }
    throw new NotAvailableException();
  }
View Full Code Here

TOP

Related Classes of org.formulacompiler.runtime.NotAvailableException

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.