1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.gwe.p2elv2;
18
19 import java.util.HashMap;
20 import java.util.List;
21 import java.util.Map;
22
23
24
25
26
27
28 public abstract class PFunction {
29
30 private static Map<String, PFunction> functionsRegistry = new HashMap<String, PFunction>();
31 public static PFunction getFunction(String functionName) { return functionsRegistry.get(functionName); }
32
33 private String name;
34
35 public PFunction(String name) {
36 this.name = name;
37 functionsRegistry.put(name, this);
38 }
39
40 public String getName() {
41 return name;
42 }
43
44 public boolean isSingleValue(List<String> params) {
45 return false;
46 }
47
48 public boolean isRuntime() {
49 return false;
50 }
51
52 public boolean isCompiletime() {
53 return !isRuntime();
54 }
55
56 public abstract PVarValueSpace calculateValues(List<String> params, PStatementContext ctx);
57 }
58