Examples of FreeRefFunction


Examples of org.apache.poi.ss.formula.functions.FreeRefFunction

    }

    public NameXPxg getNameXPtg(String name, SheetIdentifier sheet) {
      // First, try to find it as a User Defined Function
        IndexedUDFFinder udfFinder = (IndexedUDFFinder)getUDFFinder();
        FreeRefFunction func = udfFinder.findFunction(name);
        if (func != null) {
            return new NameXPxg(null, name);
        }
       
        // Otherwise, try it as a named range
View Full Code Here

Examples of org.apache.poi.ss.formula.functions.FreeRefFunction

     throw new RuntimeException("Not implemented yet");
  }

  public NameXPtg getNameXPtg(String name) {
        IndexedUDFFinder udfFinder = (IndexedUDFFinder)getUDFFinder();
        FreeRefFunction func = udfFinder.findFunction(name);
    if(func == null) return null;
        else return new NameXPtg(0, udfFinder.getFunctionIndex(name));
  }
View Full Code Here

Examples of org.apache.poi.ss.formula.functions.FreeRefFunction

      functionName = ((FunctionNameEval) nameArg).getFunctionName();
    } else {
      throw new RuntimeException("First argument should be a NameEval, but got ("
          + nameArg.getClass().getName() + ")");
    }
    FreeRefFunction targetFunc = ec.findUserDefinedFunction(functionName);
    if (targetFunc == null) {
      throw new NotImplementedFunctionException(functionName);
    }
    int nOutGoingArgs = nIncomingArgs -1;
    ValueEval[] outGoingArgs = new ValueEval[nOutGoingArgs];
    System.arraycopy(args, 1, outGoingArgs, 0, nOutGoingArgs);
    return targetFunc.evaluate(outGoingArgs, ec);
  }
View Full Code Here

Examples of org.apache.poi.ss.formula.functions.FreeRefFunction

     throw new RuntimeException("Not implemented yet");
  }

  public NameXPtg getNameXPtg(String name) {
        IndexedUDFFinder udfFinder = (IndexedUDFFinder)getUDFFinder();
        FreeRefFunction func = udfFinder.findFunction(name);
    if(func == null) return null;
        else return new NameXPtg(0, udfFinder.getFunctionIndex(name));
  }
View Full Code Here

Examples of org.apache.poi.ss.formula.functions.FreeRefFunction

      functionName = ec.getWorkbook().resolveNameXText(((NameXEval) nameArg).getPtg());
    } else {
      throw new RuntimeException("First argument should be a NameEval, but got ("
          + nameArg.getClass().getName() + ")");
    }
    FreeRefFunction targetFunc = ec.findUserDefinedFunction(functionName);
    if (targetFunc == null) {
      throw new NotImplementedException(functionName);
    }
    int nOutGoingArgs = nIncomingArgs -1;
    ValueEval[] outGoingArgs = new ValueEval[nOutGoingArgs];
    System.arraycopy(args, 1, outGoingArgs, 0, nOutGoingArgs);
    return targetFunc.evaluate(outGoingArgs, ec);
  }
View Full Code Here

Examples of org.apache.poi.ss.formula.functions.FreeRefFunction

        return m;
    }

    private static void r(Map<String, FreeRefFunction> m, String functionName, FreeRefFunction pFunc) {
        FreeRefFunction func = pFunc == null ? new NotImplemented(functionName) : pFunc;
        m.put(functionName, func);
    }
View Full Code Here

Examples of org.apache.poi.ss.formula.functions.FreeRefFunction

     */
    public static Collection<String> getSupportedFunctionNames(){
        AnalysisToolPak inst = (AnalysisToolPak)instance;
        Collection<String> lst = new TreeSet<String>();
        for(String name : inst._functionsByName.keySet()){
            FreeRefFunction func = inst._functionsByName.get(name);
            if(func != null && !(func instanceof NotImplemented)){
                lst.add(name);
            }
        }
        return Collections.unmodifiableCollection(lst);
View Full Code Here

Examples of org.apache.poi.ss.formula.functions.FreeRefFunction

     */
    public static Collection<String> getNotSupportedFunctionNames(){
        AnalysisToolPak inst = (AnalysisToolPak)instance;
        Collection<String> lst = new TreeSet<String>();
        for(String name : inst._functionsByName.keySet()){
            FreeRefFunction func = inst._functionsByName.get(name);
            if(func != null && (func instanceof NotImplemented)){
                lst.add(name);
            }
        }
        return Collections.unmodifiableCollection(lst);
View Full Code Here

Examples of org.apache.poi.ss.formula.functions.FreeRefFunction

                        "Use FunctoinEval.registerFunction(String name, Function func) instead.");
            } else {
                throw new IllegalArgumentException(name + " is not a function from the Excel Analysis Toolpack.");
            }
        }
        FreeRefFunction f = inst.findFunction(name);
        if(f != null && !(f instanceof NotImplemented)) {
            throw new IllegalArgumentException("POI already implememts " + name +
                    ". You cannot override POI's implementations of Excel functions");
        }
View Full Code Here

Examples of org.apache.poi.ss.formula.functions.FreeRefFunction

   *
   * @param name Name of function.
   * @return Function executor. <code>null</code> if not found
   */
  public FreeRefFunction findFunction(String name) {
    FreeRefFunction evaluatorForFunction;
    for (UDFFinder pack : _usedToolPacks) {
      evaluatorForFunction = pack.findFunction(name);
      if (evaluatorForFunction != null) {
        return evaluatorForFunction;
      }
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.