hep.aida.ref.function
Class FunctionCatalog

java.lang.Object
  extended by hep.aida.ref.function.FunctionCatalog
All Implemented Interfaces:
hep.aida.dev.IDevFunctionCatalog, IFunctionCatalog, Serializable

public class FunctionCatalog
extends Object
implements hep.aida.dev.IDevFunctionCatalog, Serializable

See Also:
Serialized Form

Field Summary
static String[] defaultNames
           
static String prefix
           
 
Method Summary
 boolean add(String nameId, IFunction f)
          Remember persistently definition (code!) of a function under a name.
 boolean add(String nameId, String codelet)
           
 IFunction clone(String nameInATree, IFunction f)
           
 IFunction create(String model)
          Load implementation of a model function from a persistent storage and create a new object.
 IFunction create(String name, String model)
           
 String[] defaultFunctions()
           
static FunctionCatalog getFunctionCatalog()
           
static FunctionCatalog getFunctionCatalog(String fileName)
           
 FunctionCreator getFunctionCreator()
           
 String[] list()
           
 void loadAll(String nameOnDisk)
           
static void main(String[] args)
           
 void remove(String nameId)
           
 void storeAll(String nameOnDisk)
           
static void test1()
           
static void test2()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultNames

public static String[] defaultNames

prefix

public static String prefix
Method Detail

getFunctionCatalog

public static FunctionCatalog getFunctionCatalog()

getFunctionCatalog

public static FunctionCatalog getFunctionCatalog(String fileName)
                                          throws IOException
Throws:
IOException

add

public boolean add(String nameId,
                   IFunction f)
Description copied from interface: IFunctionCatalog
Remember persistently definition (code!) of a function under a name. Scripted function created by the user may be automatically available in the subsequent analysis sessions. This is also a way to create new names for combinations of exisiting model functions ("G+G+E+P5"). Last but not least, system may be easily extended with model functions developed in the programming language directly. Predefined functions: "G","E","Pn".

Specified by:
add in interface IFunctionCatalog

add

public boolean add(String nameId,
                   String codelet)
Specified by:
add in interface IFunctionCatalog

list

public String[] list()
Specified by:
list in interface IFunctionCatalog

create

public IFunction create(String model)
Description copied from interface: hep.aida.dev.IDevFunctionCatalog
Load implementation of a model function from a persistent storage and create a new object. Look-up for the proper shared library with the code for the function and load if not already loaded. This is much more that a simple factory method and in fact is a part of developper interface - user can use createFunctionByName from IFunctionFactory.

Specified by:
create in interface hep.aida.dev.IDevFunctionCatalog

create

public IFunction create(String name,
                        String model)

clone

public IFunction clone(String nameInATree,
                       IFunction f)

defaultFunctions

public String[] defaultFunctions()

loadAll

public void loadAll(String nameOnDisk)
             throws IOException
Specified by:
loadAll in interface IFunctionCatalog
Throws:
IOException

storeAll

public void storeAll(String nameOnDisk)
              throws IOException
Specified by:
storeAll in interface IFunctionCatalog
Throws:
IOException

remove

public void remove(String nameId)
Specified by:
remove in interface IFunctionCatalog

getFunctionCreator

public FunctionCreator getFunctionCreator()

toString

public String toString()
Overrides:
toString in class Object

main

public static void main(String[] args)
                 throws ClassNotFoundException,
                        FileNotFoundException,
                        IOException
Throws:
ClassNotFoundException
FileNotFoundException
IOException

test1

public static void test1()
                  throws ClassNotFoundException,
                         FileNotFoundException,
                         IOException
Throws:
ClassNotFoundException
FileNotFoundException
IOException

test2

public static void test2()
                  throws ClassNotFoundException,
                         FileNotFoundException,
                         IOException
Throws:
ClassNotFoundException
FileNotFoundException
IOException


jHepWork 3.2 © jWork.org