Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
borderStylesolid
// The AIDA Factories
IAnalysisFactory af = IAnalysisFactory.create();
ITree = af.createTreeFactory().create();
IFunctionFactory ff = af.createFunctionFactory(tree);

// Register the function myFunc with the catalog.
// Note that there are many ways in which myFunc could have been created.
ff.catalog().add("myFunc",myFunc);

IFunction func = ff.createFunctionByName("func","g+myFunc");

When registering a coded function with the function's catalog it is imperative to properly define the function's codelet in the function's implementation. For scripted functions the codelet is defined automatically by the underlying implementation.

Codelet

Panel
borderColor#ccc
bgColor#FFFFCE
titleBGColor#F7D6C1
titleFeedback needed
borderStyledashed

The function's codelet is a unique string that is used internally by the function's factory to uniquely identify a function and be able to create it and clone it.
When registering a user defined function, the user must provide a valid codelet for the function's factory to be able to create and clone the new It basically tells the function factory where to find the code to instantiate the given function.
It is possible to create functions from:

  • scripts
  • jar files
  • URLs
  • other exising catalogs