Class ZKUDFFinder

java.lang.Object
io.keikaiex.formula.ZKUDFFinder

public class ZKUDFFinder extends Object
Static registry of user-defined functions for the Keikai formula engine.

POI removal Keikai-native rewrite. The registry now holds Keikai's FreeRefFunction (signature (ValueEval[], Object) -> ValueEval) — POI's org.apache.poi.ss.formula.functions.FreeRefFunction is gone.

Customer migration from pre-Phase-7:

   // Before — POI types:
   import org.apache.poi.ss.formula.eval.NumberEval;
   ZKUDFFinder.putFunction("DOUBLE", (args, ec) -> new NumberEval(42.0));

   // After — Keikai-native types:
   import io.keikai.range.formula.NumberEval;
   ZKUDFFinder.putFunction("DOUBLE", (args, ec) -> new NumberEval(42.0));
 
The two API shapes are identical apart from the import package; every customer UDF body remains unchanged.
Author:
henrichen, dennischen
  • Field Details

  • Method Details

    • putFunction

      public static void putFunction(String name, FreeRefFunction fn)
      Register a custom user-defined function. Replaces any existing registration of the same name.

      POI removal: the parameter type is now FreeRefFunction — Keikai-native. Customer code that previously used POI's org.apache.poi.ss.formula.functions.FreeRefFunction recompiles after a one-line import change to io.keikai.range.formula.FreeRefFunction (and the same package change for the result type — see class javadoc).

      Parameters:
      name - function name (case-insensitive at lookup; stored verbatim)
      fn - the function implementation
    • putKeikaiFunction

      @Deprecated public static void putKeikaiFunction(String name, FreeRefFunction fn)
      Deprecated.
      Phase-7 alias for putFunction(String, FreeRefFunction); the method-name distinction was needed only while the POI-typed overload coexisted. Customers can call the plain putFunction(java.lang.String, io.keikai.range.formula.FreeRefFunction) form.
    • findFunction

      public FreeRefFunction findFunction(String name)
      Resolve a function name to its registered implementation. Returns null when no entry matches.

      The lookup strips the Excel 2010+ _xlfn. prefix and falls back to ELEvalFunction (TLD lookup) for unknown names. An entry that resolves to null (an explicit "unsupported" placeholder, e.g. PHONETIC) returns the UNSUPPORTED_FUNCTION sentinel which surfaces #NAME?.