[Schmitzm-commits] r2276 - trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Mon Mar 18 23:47:51 CET 2013


Author: alfonx
Date: 2013-03-18 23:47:51 +0100 (Mon, 18 Mar 2013)
New Revision: 2276

Modified:
   trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/Bundesland.java
Log:


Modified: trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/Bundesland.java
===================================================================
--- trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/Bundesland.java	2013-03-14 15:00:57 UTC (rev 2275)
+++ trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/Bundesland.java	2013-03-18 22:47:51 UTC (rev 2276)
@@ -8,23 +8,26 @@
 	final static List<Bundesland> list = new ArrayList<>();
 
 	static {
-		list.add(new Bundesland(1, "Schleswig-Holstein", "SH", "(?:\\bSchle[sß]+wig\\s*.?[Hh]olstein|SH)\\b"));
-		list.add(new Bundesland(2, "Hamburg", "HH", "(?:\\bHamburg|HH)\\b"));
-		list.add(new Bundesland(3, "Niedersachsen", "NI", "(?:\\bNiedersachsen|NI)\\b"));
-		list.add(new Bundesland(4, "Bremen", "HB", "(?:\\bBremen|HB)\\b"));
-		list.add(new Bundesland(5, "Nordrhein-Westfalen", "NW", "(?:\\bNordrhein\\s*.?[Ww]estfalen|NRW|NW)\\b"));
-		list.add(new Bundesland(6, "Hessen", "HE", "(?:\\bHessen|HE)\\b"));
-		list.add(new Bundesland(7, "Rheinland-Pfalz", "RP", "(?:\\bRheinland-?[Pp]falz|RP)\\b"));
-		list.add(new Bundesland(8, "Baden-Württemberg", "BW", "(?:\\bBaden-?[Ww]..?rtt?emberg|BW\\b)\\b"));
-		list.add(new Bundesland(9, "Bayern", "BY", "(?:\\bBayern|BY|BAY)\\b"));
-		list.add(new Bundesland(10, "Saarland", "SL", "(?:\\bSaarland|SL)\\b"));
-		list.add(new Bundesland(11, "Berlin", "BE", "(?:\\bBerlin|BE\\b)\\b"));
-		list.add(new Bundesland(12, "Brandenburg", "BB", "(?:\\bBrandenburg|BB)\\b"));
-		list.add(new Bundesland(13, "Mecklenburg-Vorpommern", "MV",
+		list.add(new Bundesland(1, "Schleswig-Holstein", "SH", new String[] {},
+				"(?:\\bSchle[sß]+wig\\s*.?[Hh]olstein|SH)\\b"));
+		list.add(new Bundesland(2, "Hamburg", "HH", new String[] { "H" }, "(?:\\bHamburg|HH)\\b"));
+		list.add(new Bundesland(3, "Niedersachsen", "NI", new String[] {}, "(?:\\bNiedersachsen|NI)\\b"));
+		list.add(new Bundesland(4, "Bremen", "HB", new String[] {}, "(?:\\bBremen|HB)\\b"));
+		list.add(new Bundesland(5, "Nordrhein-Westfalen", "NW", new String[] { "NRW", "Nordrheinwestfalen" },
+				"(?:\\bNordrhein\\s*.?[Ww]estfalen|NRW|NW)\\b"));
+		list.add(new Bundesland(6, "Hessen", "HE", new String[] {}, "(?:\\bHessen|HE)\\b"));
+		list.add(new Bundesland(7, "Rheinland-Pfalz", "RP", new String[] {}, "(?:\\bRheinland-?[Pp]falz|RP)\\b"));
+		list.add(new Bundesland(8, "Baden-Württemberg", "BW", new String[] { "Badenwürttemberg" },
+				"(?:\\bBaden-?[Ww]..?rtt?emberg|BW\\b)\\b"));
+		list.add(new Bundesland(9, "Bayern", "BY", new String[] { "BAY" }, "(?:\\bBayern|BY|BAY)\\b"));
+		list.add(new Bundesland(10, "Saarland", "SL", new String[] {}, "(?:\\bSaarland|SL)\\b"));
+		list.add(new Bundesland(11, "Berlin", "BE", new String[] {}, "(?:\\bBerlin|BE\\b)\\b"));
+		list.add(new Bundesland(12, "Brandenburg", "BB", new String[] {}, "(?:\\bBrandenburg|BB)\\b"));
+		list.add(new Bundesland(13, "Mecklenburg-Vorpommern", "MV", new String[] {},
 				"(?:\\bMec?klenburg.?[Vv]orpomm?ern|Mec?klenburg|MV|MV)\\b"));
-		list.add(new Bundesland(14, "Sachsen", "SN", "(?:\\bSachsen\\b|SN)\\b"));
-		list.add(new Bundesland(15, "Sachsen-Anhalt", "ST", "(?:\\bSachsen.?[Aa]nhalt|ST)\\b"));
-		list.add(new Bundesland(16, "Thüringen", "TH", "(?:\\bTh(?:ue|ü)" + "ringen|TH)\\b"));
+		list.add(new Bundesland(14, "Sachsen", "SN", new String[] {}, "(?:\\bSachsen\\b|SN)\\b"));
+		list.add(new Bundesland(15, "Sachsen-Anhalt", "ST", new String[] {}, "(?:\\bSachsen.?[Aa]nhalt|ST)\\b"));
+		list.add(new Bundesland(16, "Thüringen", "TH", new String[] {}, "(?:\\bTh(?:ue|ü)" + "ringen|TH)\\b"));
 
 	}
 
@@ -37,14 +40,16 @@
 	}
 
 	private int id;
-	String name;
-	String abkuerzung;
+	final String name;
+	final String abkuerzung;
+	final String[] synonyme;
 	private String regex;
 
-	public Bundesland(int id, String name, String abkuerzung, String regex) {
+	public Bundesland(int id, String name, String abkuerzung, String[] synonyme, String regex) {
 		this.id = id;
 		this.name = name;
 		this.abkuerzung = abkuerzung;
+		this.synonyme = synonyme;
 		this.regex = regex;
 	}
 
@@ -52,16 +57,18 @@
 		return name;
 	}
 
-	public void setName(String name) {
-		this.name = name;
-	}
-
+	/**
+	 * Liefert eine offizielle 2-Stellige Abkürzung
+	 */
 	public String getAbkuerzung() {
 		return abkuerzung;
 	}
 
-	public void setAbkuerzung(String abkuerzung) {
-		this.abkuerzung = abkuerzung;
+	/**
+	 * Liefert Synonyme für dieses Bundesland, ohne den Namen oder die Abkürzung zu wiederholen. 
+	 */
+	public String[] getSynonyme() {
+		return synonyme;
 	}
 
 	public void setId(int id) {



More information about the Schmitzm-commits mailing list