|
6 | 6 | package de.bbk.concurreport; |
7 | 7 |
|
8 | 8 | import de.bbk.concur.util.SavedTables; |
| 9 | +import ec.tss.sa.documents.SaDocument; |
| 10 | +import java.util.function.Function; |
9 | 11 |
|
10 | 12 | /** |
11 | 13 | * |
12 | 14 | * @author s4504tw |
13 | 15 | */ |
14 | 16 | public enum MainTable { |
15 | | - SERIES("Series", SavedTables.COMPOSITE_RESULTS_SERIES), |
16 | | - SERIES_WITH_FORECAST("Series with forecast", SavedTables.COMPOSITE_RESULTS_SERIES_WITH_FORECAST), |
17 | | - SEASONALLY_ADJUSTED("Seasonally adjusted", SavedTables.COMPOSITE_RESULTS_SEASONALLY_ADJUSTED), |
18 | | - SEASONALLY_ADJUSTED_WITH_FORECAST("Seasonally adjusted with forecast", SavedTables.COMPOSITE_RESULTS_SEASONALLY_ADJUSTED_WITH_FORECAST), |
19 | | - TREND("Trend", SavedTables.COMPOSITE_RESULTS_TREND), |
20 | | - TREND_WITH_FORECAST("Trend with forecast", SavedTables.COMPOSITE_RESULTS_TREND_WITH_FORECAST), |
21 | | - SEASONAL("Seasonal", SavedTables.COMPOSITE_RESULTS_SEASONAL), |
22 | | - SEASONAL_WITH_FORECAST("Seasonal with forecast", SavedTables.COMPOSITE_RESULTS_SEASONAL_WITH_FORECAST), |
23 | | - CALENDAR("Calendar", SavedTables.COMPOSITE_RESULTS_CALENDAR), |
24 | | - CALENDAR_WITH_FORECAST("Calendar with forecast", SavedTables.COMPOSITE_RESULTS_CALENDAR_WITH_FORECAST), |
25 | | - IRREGULAR("Irregular", SavedTables.COMPOSITE_RESULTS_IRREGULAR), |
26 | | - IRREGULAR_WITH_FORECAST("Irregular with forecast", SavedTables.COMPOSITE_RESULTS_IRREGULAR_WITH_FORECAST); |
| 17 | + SERIES("Series", t -> SavedTables.COMPOSITE_RESULTS_SERIES), |
| 18 | + SERIES_WITH_FORECAST("Series with forecast", t -> SavedTables.COMPOSITE_RESULTS_SERIES_WITH_FORECAST), |
| 19 | + SEASONALLY_ADJUSTED("Seasonally adjusted", t -> SavedTables.COMPOSITE_RESULTS_SEASONALLY_ADJUSTED), |
| 20 | + SEASONALLY_ADJUSTED_WITH_FORECAST("Seasonally adjusted with forecast", t -> SavedTables.COMPOSITE_RESULTS_SEASONALLY_ADJUSTED_WITH_FORECAST), |
| 21 | + TREND("Trend", t -> SavedTables.COMPOSITE_RESULTS_TREND), |
| 22 | + TREND_WITH_FORECAST("Trend with forecast", t -> SavedTables.COMPOSITE_RESULTS_TREND_WITH_FORECAST), |
| 23 | + SEASONAL("Seasonal", t -> SavedTables.pickSeasonalCompositeFor(t)), |
| 24 | + SEASONAL_WITH_FORECAST("Seasonal with forecast", t -> SavedTables.pickSeasonalWithForecastCompositeFor(t)), |
| 25 | + CALENDAR("Calendar", t -> SavedTables.COMPOSITE_RESULTS_CALENDAR), |
| 26 | + CALENDAR_WITH_FORECAST("Calendar with forecast", t -> SavedTables.COMPOSITE_RESULTS_CALENDAR_WITH_FORECAST), |
| 27 | + IRREGULAR("Irregular", t -> SavedTables.COMPOSITE_RESULTS_IRREGULAR), |
| 28 | + IRREGULAR_WITH_FORECAST("Irregular with forecast", t -> SavedTables.COMPOSITE_RESULTS_IRREGULAR_WITH_FORECAST); |
27 | 29 |
|
28 | 30 | private final String displayName; |
29 | | - private final String compositeFormula; |
| 31 | + private final Function<SaDocument, String> function; |
30 | 32 |
|
31 | | - private MainTable(String displayName, String compositeFormula) { |
| 33 | + private MainTable(String displayName, Function<SaDocument, String> compositeFormula) { |
32 | 34 | this.displayName = displayName; |
33 | | - this.compositeFormula = compositeFormula; |
| 35 | + this.function = compositeFormula; |
34 | 36 | } |
35 | 37 |
|
36 | 38 | @Override |
37 | 39 | public String toString() { |
38 | 40 | return displayName; |
39 | 41 | } |
40 | 42 |
|
41 | | - public String getCompositeFormula() { |
42 | | - return compositeFormula; |
| 43 | + public Function<SaDocument, String> getFunction() { |
| 44 | + return function; |
43 | 45 | } |
44 | 46 |
|
45 | 47 | public static MainTable fromDisplayName(String displayName) { |
|
0 commit comments