/[projects]/dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/Constants.java
ViewVC logotype

Contents of /dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/Constants.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2200 - (show annotations) (download)
Thu Sep 11 08:14:40 2014 UTC (9 years, 8 months ago) by torben
File size: 667 byte(s)
Generalize solution so it also works with BK - all distributor specific values are moved to Constants system
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
13 public static Constants getInstance() { //Singleton-ish
14 return singleton;
15 }
16
17 public static void init(String distributor) {
18
19 if (distributor.equals("DAO")) {
20 singleton = new DaoConstants();
21 } else if (distributor.equals("BK")){
22 singleton = new BKConstants();
23 } else {
24 System.out.println("Ukendt distributor: " + distributor);
25 System.exit(0);
26 }
27
28 }
29
30
31 }

  ViewVC Help
Powered by ViewVC 1.1.20