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 getLatitudeMargin();
|
8 |
|
|
abstract public double getLongitudeMargin();
|
9 |
|
|
|
10 |
|
|
abstract public double getMaxDistance();
|
11 |
|
|
|
12 |
torben |
2203 |
abstract public int getMinPostnr();
|
13 |
|
|
abstract public int getMaxPostnr();
|
14 |
torben |
2200 |
|
15 |
torben |
2203 |
|
16 |
torben |
2200 |
public static Constants getInstance() { //Singleton-ish
|
17 |
|
|
return singleton;
|
18 |
|
|
}
|
19 |
|
|
|
20 |
|
|
public static void init(String distributor) {
|
21 |
|
|
|
22 |
|
|
if (distributor.equals("DAO")) {
|
23 |
|
|
singleton = new DaoConstants();
|
24 |
|
|
} else if (distributor.equals("BK")){
|
25 |
|
|
singleton = new BKConstants();
|
26 |
|
|
} else {
|
27 |
|
|
System.out.println("Ukendt distributor: " + distributor);
|
28 |
|
|
System.exit(0);
|
29 |
|
|
}
|
30 |
|
|
|
31 |
|
|
}
|
32 |
|
|
|
33 |
|
|
|
34 |
|
|
}
|