|
3 | 3 | import java.lang.reflect.Method; |
4 | 4 |
|
5 | 5 | /** |
| 6 | + * <p> |
6 | 7 | * Keep a registry of methods. The Java methods (either class or object method) |
7 | 8 | * can be called from interpreted script. The problem is that Java methods can |
8 | 9 | * be overloaded and BASIC functions can not. To overcome this issue the BASIC |
9 | 10 | * program has to declare a function name for each method it wants to call. For |
10 | 11 | * example: |
11 | | - * <p> |
| 12 | + * </p> |
12 | 13 | * <pre> |
13 | 14 | * method sin from java.lang.Math is (double) use as sinus |
14 | 15 | * </pre> |
|
19 | 20 | * the method will be used as the name of the BASIC function and no alias is |
20 | 21 | * used. If this part is defined then the alias will be used as the name of the |
21 | 22 | * function. |
| 23 | + * </p> |
22 | 24 | * <p> |
23 | 25 | * If there are two methods of the same name, with different signature, you have |
24 | 26 | * to define different aliases for the different methods. |
| 27 | + * </p> |
25 | 28 | * <p> |
26 | 29 | * You can use the same alias for different methods in different packages. This |
27 | 30 | * can be done because the class name or alias for the class name or the |
28 | 31 | * variable holding the Java object reference stands in front of the method |
29 | 32 | * name/alias when the registered method is called. This distinguishes the |
30 | 33 | * different methods of different class even if the aliases or the method names |
31 | 34 | * are the same. |
| 35 | + * </p> |
32 | 36 | * <p> |
33 | 37 | * Also note that you can also use aliases for Class names defined in the |
34 | 38 | * statement {@code use}. |
35 | | - * <p> |
| 39 | + * </p> |
36 | 40 | * The registry keeps track of the |
37 | 41 | * <ul> |
38 | 42 | * <li>name of the method, |
39 | 43 | * <li>the alias, |
40 | 44 | * <li>the class and |
41 | 45 | * <li>the signature. |
42 | 46 | * </ul> |
| 47 | + * <p> |
43 | 48 | * Thus whenever there is a function call in BASIC to call a Java method in a |
44 | 49 | * certain class this registry will know which signature to use for the certain |
45 | 50 | * alias. |
46 | | - * <p> |
| 51 | + * </p> |
47 | 52 | * Aliases can be global or class specific. When an alias is defined for a |
48 | 53 | * single method then the alias can be used without the class specification. |
49 | 54 | * This appears in the BASIC code as a simple function call. When a method is |
|
0 commit comments