mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-20 09:19:57 +00:00
added 'Nord', 'Ost', 'Süd', 'West' to names that need places in their unique form
This commit is contained in:
parent
33a804ab3f
commit
789cce3548
1 changed files with 8 additions and 1 deletions
|
@ -18,6 +18,7 @@
|
||||||
package de.schildbach.pte.dto;
|
package de.schildbach.pte.dto;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andreas Schildbach
|
* @author Andreas Schildbach
|
||||||
|
@ -92,9 +93,15 @@ public final class Location implements Serializable
|
||||||
return lat != 0 || lon != 0;
|
return lat != 0 || lon != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final String[] NON_UNIQUE_NAMES = { "Hauptbahnhof", "Hbf", "Bahnhof", "Dorf", "Kirche", "Nord", "Ost", "Süd", "West" };
|
||||||
|
static
|
||||||
|
{
|
||||||
|
Arrays.sort(NON_UNIQUE_NAMES);
|
||||||
|
}
|
||||||
|
|
||||||
public final String uniqueShortName()
|
public final String uniqueShortName()
|
||||||
{
|
{
|
||||||
if ("Hauptbahnhof".equals(name) || "Hbf".equals(name) || "Bahnhof".equals(name) || "Dorf".equals(name) || "Kirche".equals(name))
|
if (name != null && Arrays.binarySearch(NON_UNIQUE_NAMES, name) >= 0)
|
||||||
return place + ", " + name;
|
return place + ", " + name;
|
||||||
else if (name != null)
|
else if (name != null)
|
||||||
return name;
|
return name;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue