1 |
torben |
2200 |
package dk.daoas.fulddaekning;
|
2 |
|
|
|
3 |
|
|
public abstract class Constants {
|
4 |
|
|
|
5 |
|
|
private static Constants singleton = null;
|
6 |
|
|
|
7 |
|
|
abstract public double getMaxDistance();
|
8 |
torben |
2330 |
abstract public double getKmMargin();
|
9 |
torben |
2200 |
|
10 |
torben |
2203 |
abstract public int getMinPostnr();
|
11 |
|
|
abstract public int getMaxPostnr();
|
12 |
torben |
2200 |
|
13 |
torben |
2223 |
abstract public String getTableExtension();
|
14 |
torben |
2203 |
|
15 |
torben |
2228 |
abstract public boolean doExtendedLookup();
|
16 |
torben |
2223 |
|
17 |
torben |
2231 |
abstract public boolean doCheckHO();
|
18 |
torben |
2228 |
|
19 |
torben |
2231 |
|
20 |
torben |
2200 |
public static Constants getInstance() { //Singleton-ish
|
21 |
|
|
return singleton;
|
22 |
|
|
}
|
23 |
|
|
|
24 |
|
|
public static void init(String distributor) {
|
25 |
|
|
|
26 |
|
|
if (distributor.equals("DAO")) {
|
27 |
|
|
singleton = new DaoConstants();
|
28 |
|
|
} else if (distributor.equals("BK")){
|
29 |
|
|
singleton = new BKConstants();
|
30 |
|
|
} else {
|
31 |
|
|
System.out.println("Ukendt distributor: " + distributor);
|
32 |
|
|
System.exit(0);
|
33 |
|
|
}
|
34 |
|
|
|
35 |
|
|
}
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
}
|