Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/math/fitting/FunctionFactory.java @ 9643:58f3fe98fd6b
Fitting new Option UI
author | dnt_bjoernsen <d.tironi@bjoernsen.de> |
---|---|
date | Mon, 02 Dec 2019 14:14:06 +0100 |
parents | af13ceeba52a |
children |
comparison
equal
deleted
inserted
replaced
9642:3987fef69143 | 9643:58f3fe98fd6b |
---|---|
10 | 10 |
11 import java.util.Collection; | 11 import java.util.Collection; |
12 import java.util.LinkedHashMap; | 12 import java.util.LinkedHashMap; |
13 import java.util.Map; | 13 import java.util.Map; |
14 | 14 |
15 public final class FunctionFactory | 15 public final class FunctionFactory { |
16 { | |
17 private static FunctionFactory instance; | 16 private static FunctionFactory instance; |
18 | 17 |
19 private Map<String, Function> functions; | 18 private final Map<String, Function> functions; |
20 | 19 |
21 private FunctionFactory() { | 20 private FunctionFactory() { |
22 functions = new LinkedHashMap<String, Function>(); | 21 this.functions = new LinkedHashMap<>(); |
23 | 22 |
24 registerFunction(Log.INSTANCE); | 23 registerFunction(Log.INSTANCE); |
25 registerFunction(Linear.INSTANCE); | 24 registerFunction(Linear.INSTANCE); |
26 registerFunction(LogLinear.INSTANCE); | 25 registerFunction(LogLinear.INSTANCE); |
26 registerFunction(LogLinearAlternative.INSTANCE); | |
27 registerFunction(Exp.INSTANCE); | 27 registerFunction(Exp.INSTANCE); |
28 registerFunction(Quad.INSTANCE); | 28 registerFunction(Quad.INSTANCE); |
29 registerFunction(Pow.INSTANCE); | 29 registerFunction(Pow.INSTANCE); |
30 registerFunction(SQPow.INSTANCE); | 30 registerFunction(SQPow.INSTANCE); |
31 } | 31 } |
35 instance = new FunctionFactory(); | 35 instance = new FunctionFactory(); |
36 } | 36 } |
37 return instance; | 37 return instance; |
38 } | 38 } |
39 | 39 |
40 public Function getFunction(String name) { | 40 public Function getFunction(final String name) { |
41 return functions.get(name); | 41 return this.functions.get(name); |
42 } | 42 } |
43 | 43 |
44 public void registerFunction(Function function) { | 44 public void registerFunction(final Function function) { |
45 functions.put(function.getName(), function); | 45 this.functions.put(function.getName(), function); |
46 } | 46 } |
47 | 47 |
48 public Collection<Function> getFunctions() { | 48 public Collection<Function> getFunctions() { |
49 return functions.values(); | 49 return this.functions.values(); |
50 } | 50 } |
51 } | 51 } |
52 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 52 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |