Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/math/fitting/FunctionFactory.java @ 4272:270f3ac8a82e
In ExtremeAccess, fix typo that lead to incorrect null-check.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 26 Oct 2012 15:09:48 +0200 |
parents | 59b14bc676ec |
children |
rev | line source |
---|---|
2569
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.math.fitting; |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import java.util.Collection; |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 import java.util.LinkedHashMap; |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 import java.util.Map; |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 public final class FunctionFactory |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 { |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 private static FunctionFactory instance; |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 private Map<String, Function> functions; |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 private FunctionFactory() { |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 functions = new LinkedHashMap<String, Function>(); |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 |
3178
59b14bc676ec
Fitting: Link the functions to there inverses via getInverse().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3100
diff
changeset
|
16 registerFunction(Log.INSTANCE); |
59b14bc676ec
Fitting: Link the functions to there inverses via getInverse().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3100
diff
changeset
|
17 registerFunction(Linear.INSTANCE); |
59b14bc676ec
Fitting: Link the functions to there inverses via getInverse().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3100
diff
changeset
|
18 registerFunction(LogLinear.INSTANCE); |
59b14bc676ec
Fitting: Link the functions to there inverses via getInverse().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3100
diff
changeset
|
19 registerFunction(Exp.INSTANCE); |
59b14bc676ec
Fitting: Link the functions to there inverses via getInverse().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3100
diff
changeset
|
20 registerFunction(Quad.INSTANCE); |
59b14bc676ec
Fitting: Link the functions to there inverses via getInverse().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3100
diff
changeset
|
21 registerFunction(Pow.INSTANCE); |
59b14bc676ec
Fitting: Link the functions to there inverses via getInverse().
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3100
diff
changeset
|
22 registerFunction(SQPow.INSTANCE); |
2569
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 } |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 public static synchronized FunctionFactory getInstance() { |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 if (instance == null) { |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 instance = new FunctionFactory(); |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 } |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 return instance; |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 } |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 public Function getFunction(String name) { |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 return functions.get(name); |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 } |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 public void registerFunction(Function function) { |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 functions.put(function.getName(), function); |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 } |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 public Collection<Function> getFunctions() { |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 return functions.values(); |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 } |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 } |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |