svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.expressionevaluator / org.gvsig.expressionevaluator.lib / org.gvsig.expressionevaluator.lib.api / src / main / java / org / gvsig / expressionevaluator / Function.java @ 46505
History | View | Annotate | Download (2.14 KB)
1 | 43512 | jjdelcerro | package org.gvsig.expressionevaluator; |
---|---|---|---|
2 | |||
3 | import java.util.List; |
||
4 | import org.apache.commons.lang3.Range; |
||
5 | 46505 | fdiaz | import org.gvsig.expressionevaluator.ExpressionBuilder.Value; |
6 | 43512 | jjdelcerro | |
7 | public interface Function { |
||
8 | |||
9 | 43521 | jjdelcerro | public final String GROUP_NUMERIC = "Numeric"; |
10 | public final String GROUP_STRING = "String"; |
||
11 | public final String GROUP_DATETIME = "Datetime"; |
||
12 | public final String GROUP_BOOLEAN = "Boolean"; |
||
13 | public final String GROUP_OGC = "OGC"; |
||
14 | 44139 | jjdelcerro | public final String GROUP_PROGRAMMING = "Programming"; |
15 | 44198 | jjdelcerro | public final String GROUP_CONVERSION = "Conversion"; |
16 | 44712 | jjdelcerro | public final String GROUP_AGGREGATE = "Aggregate"; |
17 | 43939 | jjdelcerro | public final String GROUP_OTHER = "Other"; |
18 | 43521 | jjdelcerro | |
19 | 43512 | jjdelcerro | public String group(); |
20 | |||
21 | public String name(); |
||
22 | 43939 | jjdelcerro | |
23 | public String returnType(); |
||
24 | 43512 | jjdelcerro | |
25 | public Range argc();
|
||
26 | |||
27 | public String description(); |
||
28 | |||
29 | 44924 | jjdelcerro | /**
|
30 | * Return a full description of the funcion internationalized in HTML.
|
||
31 | * This full description contains, t name, description, args, template and
|
||
32 | * return type.
|
||
33 | *
|
||
34 | * @return full description in HTML as a String
|
||
35 | */
|
||
36 | public String getFullDescription(); |
||
37 | |||
38 | 43521 | jjdelcerro | public String template(); |
39 | |||
40 | 43512 | jjdelcerro | public String[] descriptionArgs(); |
41 | |||
42 | 43521 | jjdelcerro | public Object call(Interpreter interpreter, Object[] args) throws Exception; |
43 | 43512 | jjdelcerro | |
44 | 44139 | jjdelcerro | public Object call(Interpreter interpreter, Codes args) throws Exception; |
45 | 43939 | jjdelcerro | |
46 | 43512 | jjdelcerro | public void addAlias(String name); |
47 | |||
48 | 44139 | jjdelcerro | public List<String> aliases(); |
49 | 43521 | jjdelcerro | |
50 | public boolean isOperator(); |
||
51 | 43939 | jjdelcerro | |
52 | 44738 | jjdelcerro | public boolean isHidden(); |
53 | |||
54 | 43939 | jjdelcerro | public boolean useArgumentsInsteadObjects(); |
55 | 43989 | jjdelcerro | |
56 | public boolean isSQLCompatible(); |
||
57 | 44009 | jjdelcerro | |
58 | /**
|
||
59 | * Returns true if the function always returns the same value for
|
||
60 | * the same parameters. If so, it is possible to optimize the
|
||
61 | * generated code through the process of "constant folding".
|
||
62 | *
|
||
63 | * https://en.wikipedia.org/wiki/Constant_folding
|
||
64 | *
|
||
65 | * @return true if this function allow constant folding optimization.
|
||
66 | */
|
||
67 | public boolean allowConstantFolding(); |
||
68 | 44738 | jjdelcerro | |
69 | 45011 | jjdelcerro | public String toString(Codes args, Formatter<Code> formatter); |
70 | |||
71 | 46505 | fdiaz | public ExpressionBuilder.Value toValue(ExpressionBuilder builder, Codes parameters);
|
72 | |||
73 | 43512 | jjdelcerro | } |