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

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Sun Feb 24 22:56:52 CET 2013


Author: alfonx
Date: 2013-02-24 22:56:52 +0100 (Sun, 24 Feb 2013)
New Revision: 2254

Added:
   trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/Bundesland.java
Log:
Klasse Bundesland kennt alle Bundesl?\195?\164nder

Added: trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/Bundesland.java
===================================================================
--- trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/Bundesland.java	                        (rev 0)
+++ trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/Bundesland.java	2013-02-24 21:56:52 UTC (rev 2254)
@@ -0,0 +1,88 @@
+package de.schmitzm.adresses;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Bundesland implements Comparable<Bundesland> {
+
+	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",
+				"(?:\\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"));
+
+	}
+
+	/**
+	 * Liefert alle deutschen Bundesländer (Stand 2012) mit Ihren Abkürzungen und passenden Regex.
+	 */
+	public static List<Bundesland> getList() {
+		return list;
+
+	}
+
+	private int id;
+	String name;
+	String abkuerzung;
+	private String regex;
+
+	public Bundesland(int id, String name, String abkuerzung, String regex) {
+		this.id = id;
+		this.name = name;
+		this.abkuerzung = abkuerzung;
+		this.regex = regex;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getAbkuerzung() {
+		return abkuerzung;
+	}
+
+	public void setAbkuerzung(String abkuerzung) {
+		this.abkuerzung = abkuerzung;
+	}
+
+	public void setId(int id) {
+		this.id = id;
+	}
+
+	@Override
+	public int compareTo(Bundesland o) {
+		return new Integer(getId()).compareTo(o.getId());
+	}
+
+	public Integer getId() {
+		return id;
+	}
+
+	public String getRegex() {
+		return regex;
+	}
+
+	public void setRegex(String regex) {
+		this.regex = regex;
+	}
+
+}


Property changes on: trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/Bundesland.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain



More information about the Schmitzm-commits mailing list