1 |
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 |
abstract public int getMinPostnr();
|
13 |
abstract public int getMaxPostnr();
|
14 |
|
15 |
abstract public String getTableExtension();
|
16 |
|
17 |
abstract public boolean doExtendedLookup();
|
18 |
|
19 |
|
20 |
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 |
}
|