mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 06:08:52 +00:00
normalizeLine() to return Line rather than String
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@810 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
95dd3cf7ac
commit
b7ab26c57c
15 changed files with 86 additions and 127 deletions
|
@ -551,21 +551,22 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
else
|
||||
destinationId = 0;
|
||||
|
||||
final String lineStr;
|
||||
final Line line;
|
||||
if (classStr != null)
|
||||
{
|
||||
final char classChar = intToProduct(Integer.parseInt(classStr));
|
||||
final Matcher m = P_NORMALIZE_LINE.matcher(prod);
|
||||
final String lineStr;
|
||||
if (m.matches())
|
||||
lineStr = classChar + m.group(1) + m.group(2);
|
||||
else
|
||||
lineStr = classChar + prod;
|
||||
line = new Line(null, lineStr, lineStr != null ? lineColors(lineStr) : null);
|
||||
}
|
||||
else
|
||||
{
|
||||
lineStr = normalizeLine(prod);
|
||||
line = normalizeLine(prod);
|
||||
}
|
||||
final Line line = new Line(null, lineStr, lineStr != null ? lineColors(lineStr) : null);
|
||||
|
||||
final int[] capacity;
|
||||
if (capacityStr != null && !"0|0".equals(capacityStr))
|
||||
|
@ -1640,8 +1641,6 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
return 'B';
|
||||
if ("TRO".equals(ucType)) // Trolleybus
|
||||
return 'B';
|
||||
if ("AST".equals(ucType)) // Anruf-Sammel-Taxi
|
||||
return 'B';
|
||||
if ("RFB".equals(ucType)) // Rufbus
|
||||
return 'B';
|
||||
if ("RUF".equals(ucType)) // Rufbus
|
||||
|
@ -1652,11 +1651,15 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
return 'B';
|
||||
if ("LT".equals(ucType)) // Linien-Taxi
|
||||
return 'B';
|
||||
if ("ALT".equals(ucType)) // Anruf-Linien-Taxi
|
||||
return 'B';
|
||||
// if ("N".equals(normalizedType)) // Nachtbus
|
||||
// return "B" + normalizedName;
|
||||
|
||||
// Phone
|
||||
if (ucType.startsWith("AST")) // Anruf-Sammel-Taxi
|
||||
return 'P';
|
||||
if (ucType.startsWith("ALT")) // Anruf-Linien-Taxi
|
||||
return 'P';
|
||||
|
||||
// Ferry
|
||||
if ("SCHIFF".equals(ucType))
|
||||
return 'F';
|
||||
|
@ -1725,7 +1728,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
lineStr = Character.toString(normalizedType);
|
||||
}
|
||||
|
||||
return new Line(null, lineStr, lineColors(lineStr));
|
||||
return newLine(lineStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1733,7 +1736,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
}
|
||||
}
|
||||
|
||||
protected String normalizeLine(final String line)
|
||||
protected Line normalizeLine(final String line)
|
||||
{
|
||||
if (line == null || line.length() == 0)
|
||||
return null;
|
||||
|
@ -1746,7 +1749,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
|
||||
final char normalizedType = normalizeType(type);
|
||||
if (normalizedType != 0)
|
||||
return normalizedType + type + number;
|
||||
return newLine(normalizedType + type + number);
|
||||
|
||||
throw new IllegalStateException("cannot normalize type " + type + " number " + number + " line " + line);
|
||||
}
|
||||
|
@ -1754,12 +1757,17 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
throw new IllegalStateException("cannot normalize line " + line);
|
||||
}
|
||||
|
||||
protected final Line newLine(final String lineStr)
|
||||
{
|
||||
return new Line(null, lineStr, lineColors(lineStr));
|
||||
}
|
||||
|
||||
private static final Pattern P_NORMALIZE_LINE_AND_TYPE = Pattern.compile("([^#]*)#(.*)");
|
||||
private static final Pattern P_NORMALIZE_LINE_NUMBER = Pattern.compile("\\d{2,5}");
|
||||
// saved from RtProvider
|
||||
private static final Pattern P_NORMALIZE_LINE_RUSSIA = Pattern.compile("(\\d{3}(BJ|FJ|IJ|MJ|NJ|OJ|TJ|SZ))");
|
||||
|
||||
protected final String parseLineAndType(final String lineAndType)
|
||||
protected final Line parseLineAndType(final String lineAndType)
|
||||
{
|
||||
final Matcher m = P_NORMALIZE_LINE_AND_TYPE.matcher(lineAndType);
|
||||
if (m.matches())
|
||||
|
@ -1770,9 +1778,9 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
if (type.length() == 0)
|
||||
{
|
||||
if (number.length() == 0)
|
||||
return "?";
|
||||
return newLine("?");
|
||||
if (P_NORMALIZE_LINE_NUMBER.matcher(number).matches())
|
||||
return "?" + number;
|
||||
return newLine("?" + number);
|
||||
// saved from RtProvider
|
||||
// if (P_NORMALIZE_LINE_RUSSIA.matcher(number).matches())
|
||||
// return 'R' + number;
|
||||
|
@ -1781,7 +1789,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
{
|
||||
final char normalizedType = normalizeType(type);
|
||||
if (normalizedType != 0)
|
||||
return normalizedType + number;
|
||||
return newLine(normalizedType + number);
|
||||
}
|
||||
|
||||
throw new IllegalStateException("cannot normalize type " + type + " number " + number + " line#type " + lineAndType);
|
||||
|
|
|
@ -453,8 +453,7 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
|
||||
if (mDetFine.group(2) != null)
|
||||
{
|
||||
final String lineStr = normalizeLine(ParserUtils.resolveEntities(mDetFine.group(2)));
|
||||
final Line line = new Line(null, lineStr, lineColors(lineStr));
|
||||
final Line line = normalizeLine(ParserUtils.resolveEntities(mDetFine.group(2)));
|
||||
|
||||
final Calendar departureTime = new GregorianCalendar(timeZone());
|
||||
departureTime.clear();
|
||||
|
@ -555,10 +554,6 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
if ("LTT".equals(ucType))
|
||||
return 'B';
|
||||
|
||||
if (ucType.startsWith("AST")) // Anruf-Sammel-Taxi
|
||||
return 'P';
|
||||
if (ucType.startsWith("ALT")) // Anruf-Linien-Taxi
|
||||
return 'P';
|
||||
if (ucType.startsWith("RFB")) // Rufbus
|
||||
return 'P';
|
||||
|
||||
|
@ -578,22 +573,22 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
private static final Pattern P_LINE_NUMBER = Pattern.compile("\\d{2,5}");
|
||||
|
||||
@Override
|
||||
protected final String normalizeLine(final String line)
|
||||
protected final Line normalizeLine(final String line)
|
||||
{
|
||||
if ("Schw-B".equals(line)) // Schwebebahn, gilt als "Straßenbahn besonderer Bauart"
|
||||
return 'T' + line;
|
||||
return newLine('T' + line);
|
||||
|
||||
if (P_LINE_BUS_SPECIAL.matcher(line).matches())
|
||||
return "B" + line;
|
||||
return newLine('B' + line);
|
||||
|
||||
if (P_LINE_RUSSIA.matcher(line).matches())
|
||||
return 'R' + line;
|
||||
return newLine('R' + line);
|
||||
|
||||
if (P_LINE_NUMBER.matcher(line).matches())
|
||||
return "?" + line;
|
||||
return newLine('?' + line);
|
||||
|
||||
if ("---".equals(line))
|
||||
return "?" + line;
|
||||
return newLine('?' + line);
|
||||
|
||||
return super.normalizeLine(line);
|
||||
}
|
||||
|
|
|
@ -292,9 +292,9 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
final Matcher mMsgsFine = P_DEPARTURES_LIVE_MSGS_FINE.matcher(mMsgsCoarse.group(1));
|
||||
if (mMsgsFine.matches())
|
||||
{
|
||||
final String line = normalizeLine(ParserUtils.resolveEntities(mMsgsFine.group(1)));
|
||||
final Line line = normalizeLine(ParserUtils.resolveEntities(mMsgsFine.group(1)));
|
||||
final String message = ParserUtils.resolveEntities(mMsgsFine.group(3)).replace('\n', ' ');
|
||||
messages.put(line, message);
|
||||
messages.put(line.label, message);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -326,7 +326,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
else
|
||||
plannedTime = parsedTime.getTime();
|
||||
|
||||
final String line = normalizeLine(ParserUtils.resolveEntities(mDepFine.group(3)));
|
||||
final Line line = normalizeLine(ParserUtils.resolveEntities(mDepFine.group(3)));
|
||||
|
||||
final String position = null;
|
||||
|
||||
|
@ -334,8 +334,8 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
|
||||
final String destination = ParserUtils.resolveEntities(mDepFine.group(4));
|
||||
|
||||
final Departure dep = new Departure(plannedTime, predictedTime, new Line(null, line, line != null ? lineColors(line) : null),
|
||||
position, destinationId, destination, null, messages.get(line));
|
||||
final Departure dep = new Departure(plannedTime, predictedTime, line, position, destinationId, destination, null,
|
||||
messages.get(line.label));
|
||||
if (!departures.contains(dep))
|
||||
departures.add(dep);
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
|
||||
final Date plannedTime = parsedTime.getTime();
|
||||
|
||||
final String line = normalizeLine(ParserUtils.resolveEntities(mDepFine.group(2)));
|
||||
final Line line = normalizeLine(ParserUtils.resolveEntities(mDepFine.group(2)));
|
||||
|
||||
final String position = ParserUtils.resolveEntities(mDepFine.group(3));
|
||||
|
||||
|
@ -404,8 +404,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
|
||||
final String destination = ParserUtils.resolveEntities(mDepFine.group(5));
|
||||
|
||||
final Departure dep = new Departure(plannedTime, null, new Line(null, line, line != null ? lineColors(line) : null),
|
||||
position, destinationId, destination, null, null);
|
||||
final Departure dep = new Departure(plannedTime, null, line, position, destinationId, destination, null, null);
|
||||
if (!departures.contains(dep))
|
||||
departures.add(dep);
|
||||
}
|
||||
|
@ -839,8 +838,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
final String arrivalPosition = !mDetails.group(4).equals(" ") ? ParserUtils.resolveEntities(mDetails.group(4))
|
||||
: null;
|
||||
|
||||
final String lineStr = normalizeLine(ParserUtils.resolveEntities(tDep[3]));
|
||||
final Line line = new Line(null, lineStr, lineColors(lineStr));
|
||||
final Line line = normalizeLine(ParserUtils.resolveEntities(tDep[3]));
|
||||
|
||||
final Location destination;
|
||||
if (mDetails.group(3) != null)
|
||||
|
@ -901,29 +899,29 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
private static final Pattern P_LINE_NUMBER = Pattern.compile("\\d{4,}");
|
||||
|
||||
@Override
|
||||
protected String normalizeLine(final String line)
|
||||
protected Line normalizeLine(final String line)
|
||||
{
|
||||
final Matcher mRegional = P_LINE_REGIONAL.matcher(line);
|
||||
if (mRegional.matches())
|
||||
return "R" + mRegional.group(1);
|
||||
return newLine('R' + mRegional.group(1));
|
||||
|
||||
final Matcher mTram = P_LINE_TRAM.matcher(line);
|
||||
if (mTram.matches())
|
||||
return "T" + mTram.group(1);
|
||||
return newLine('T' + mTram.group(1));
|
||||
|
||||
final Matcher mBus = P_LINE_BUS.matcher(line);
|
||||
if (mBus.matches())
|
||||
return "B" + mBus.group(1);
|
||||
return newLine('B' + mBus.group(1));
|
||||
|
||||
if (P_LINE_FERRY.matcher(line).matches())
|
||||
return "F" + line;
|
||||
return newLine('F' + line);
|
||||
|
||||
final Matcher mBusSpecial = P_LINE_BUS_SPECIAL.matcher(line);
|
||||
if (mBusSpecial.matches())
|
||||
return "B" + mBusSpecial.group(1);
|
||||
return newLine('B' + mBusSpecial.group(1));
|
||||
|
||||
if (P_LINE_NUMBER.matcher(line).matches())
|
||||
return "R" + line;
|
||||
return newLine('R' + line);
|
||||
|
||||
return super.normalizeLine(line);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ package de.schildbach.pte;
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
@ -162,7 +163,7 @@ public class DsbProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
protected String normalizeLine(final String line)
|
||||
protected Line normalizeLine(final String line)
|
||||
{
|
||||
return parseLineAndType(line);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ package de.schildbach.pte;
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
@ -138,7 +139,7 @@ public class LuProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
protected String normalizeLine(final String line)
|
||||
protected Line normalizeLine(final String line)
|
||||
{
|
||||
return parseLineAndType(line);
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ public class NsProvider extends AbstractHafasProvider
|
|||
final Matcher mDepFine = P_DEPARTURES_FINE.matcher(mDepCoarse.group(1));
|
||||
if (mDepFine.matches())
|
||||
{
|
||||
final String line = normalizeLine(ParserUtils.resolveEntities(mDepFine.group(1)));
|
||||
final Line line = normalizeLine(ParserUtils.resolveEntities(mDepFine.group(1)));
|
||||
|
||||
final String destination = ParserUtils.resolveEntities(mDepFine.group(2));
|
||||
|
||||
|
@ -173,8 +173,7 @@ public class NsProvider extends AbstractHafasProvider
|
|||
|
||||
mDepFine.group(4); // TODO delay
|
||||
|
||||
final Departure dep = new Departure(parsedTime.getTime(), null, new Line(null, line, line != null ? lineColors(line) : null),
|
||||
null, 0, destination, null, null);
|
||||
final Departure dep = new Departure(parsedTime.getTime(), null, line, null, 0, destination, null, null);
|
||||
|
||||
if (!departures.contains(dep))
|
||||
departures.add(dep);
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
@ -168,6 +169,12 @@ public class OebbProvider extends AbstractHafasProvider
|
|||
WALKSPEED_MAP.put(WalkSpeed.FAST, "85");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Line normalizeLine(final String line)
|
||||
{
|
||||
return parseLineAndType(line);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected char normalizeType(final String type)
|
||||
{
|
||||
|
@ -215,8 +222,6 @@ public class OebbProvider extends AbstractHafasProvider
|
|||
|
||||
if (ucType.equals("OBU")) // Connections only?
|
||||
return 'B';
|
||||
// if (ucType.equals("ASTSV")) // via JSON API
|
||||
// return 'B';
|
||||
if (ucType.equals("ICB")) // ÖBB ICBus
|
||||
return 'B';
|
||||
if (ucType.equals("BSV")) // Deutschland, Connections only?
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.util.List;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
@ -150,7 +151,7 @@ public class PlProvider extends AbstractHafasProvider
|
|||
private static final Pattern P_NORMALIZE_LINE_NUMBER = Pattern.compile("\\d{2,5}");
|
||||
|
||||
@Override
|
||||
protected String normalizeLine(String line)
|
||||
protected Line normalizeLine(String line)
|
||||
{
|
||||
// replace badly encoded character (stations 8530643 and 8530644)
|
||||
if (line.equals("F\u0084hre"))
|
||||
|
@ -158,10 +159,10 @@ public class PlProvider extends AbstractHafasProvider
|
|||
|
||||
final Matcher mRussia = P_NORMALIZE_LINE_RUSSIA.matcher(line);
|
||||
if (mRussia.matches())
|
||||
return 'R' + mRussia.group(1);
|
||||
return newLine('R' + mRussia.group(1));
|
||||
|
||||
if (P_NORMALIZE_LINE_NUMBER.matcher(line).matches())
|
||||
return 'R' + line;
|
||||
return newLine('R' + line);
|
||||
|
||||
return super.normalizeLine(line);
|
||||
}
|
||||
|
|
|
@ -241,7 +241,7 @@ public class RmvProvider extends AbstractHafasProvider
|
|||
final Matcher mDepFine = P_DEPARTURES_FINE.matcher(mDepCoarse.group(1));
|
||||
if (mDepFine.matches())
|
||||
{
|
||||
final String line = normalizeLine(ParserUtils.resolveEntities(mDepFine.group(1)));
|
||||
final Line line = normalizeLine(ParserUtils.resolveEntities(mDepFine.group(1)));
|
||||
|
||||
final String destination = ParserUtils.resolveEntities(mDepFine.group(2));
|
||||
|
||||
|
@ -269,8 +269,8 @@ public class RmvProvider extends AbstractHafasProvider
|
|||
|
||||
final String position = ParserUtils.resolveEntities(ParserUtils.selectNotNull(mDepFine.group(5), mDepFine.group(6)));
|
||||
|
||||
final Departure dep = new Departure(plannedTime.getTime(), predictedTime != null ? predictedTime.getTime() : null, new Line(
|
||||
null, line, line != null ? lineColors(line) : null), position, 0, destination, null, null);
|
||||
final Departure dep = new Departure(plannedTime.getTime(), predictedTime != null ? predictedTime.getTime() : null, line,
|
||||
position, 0, destination, null, null);
|
||||
|
||||
if (!departures.contains(dep))
|
||||
departures.add(dep);
|
||||
|
@ -308,7 +308,7 @@ public class RmvProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
protected String normalizeLine(final String line)
|
||||
protected Line normalizeLine(final String line)
|
||||
{
|
||||
if (line == null || line.length() == 0)
|
||||
return null;
|
||||
|
@ -319,76 +319,20 @@ public class RmvProvider extends AbstractHafasProvider
|
|||
final String type = m.group(1);
|
||||
final String number = m.group(2).replace(" ", "");
|
||||
|
||||
if (type.equals("ICE")) // InterCityExpress
|
||||
return "IICE" + number;
|
||||
if (type.equals("IC")) // InterCity
|
||||
return "IIC" + number;
|
||||
if (type.equals("EC")) // EuroCity
|
||||
return "IEC" + number;
|
||||
if (type.equals("EN")) // EuroNight
|
||||
return "IEN" + number;
|
||||
if (type.equals("CNL")) // CityNightLine
|
||||
return "ICNL" + number;
|
||||
if (type.equals("DNZ")) // Basel-Minsk, Nacht
|
||||
return "IDNZ" + number;
|
||||
if (type.equals("D")) // Prag-Fulda
|
||||
return "ID" + number;
|
||||
if (type.equals("RB")) // RegionalBahn
|
||||
return "RRB" + number;
|
||||
if (type.equals("RE")) // RegionalExpress
|
||||
return "RRE" + number;
|
||||
if (type.equals("IRE")) // Interregio Express
|
||||
return "RIRE" + number;
|
||||
if (type.equals("SE")) // StadtExpress
|
||||
return "RSE" + number;
|
||||
if (type.equals("R"))
|
||||
return "R" + number;
|
||||
if (type.equals("ZUG"))
|
||||
return "R" + number;
|
||||
if (type.equals("S"))
|
||||
return "SS" + number;
|
||||
if (type.equals("U"))
|
||||
return "UU" + number;
|
||||
if (type.equals("Tram"))
|
||||
return "T" + number;
|
||||
if (type.equals("RT")) // RegioTram
|
||||
return "TRT" + number;
|
||||
if (type.startsWith("Bus"))
|
||||
return "B" + type.substring(3) + number;
|
||||
if (type.equals("B"))
|
||||
return "B" + number;
|
||||
if (type.equals("BN"))
|
||||
return "BN" + number;
|
||||
if ("BuFB".equals(type))
|
||||
return "BBuFB" + number;
|
||||
if ("A".equals(type))
|
||||
return "BA" + number;
|
||||
if (type.equals("N"))
|
||||
return "BN" + number;
|
||||
if (type.equals("AS")) // Anruf-Sammel-Taxi
|
||||
return "BAS" + number;
|
||||
if (type.equals("ASOF")) // Anruf-Sammel-Taxi
|
||||
return "BASOF" + number;
|
||||
if (type.startsWith("AST")) // Anruf-Sammel-Taxi
|
||||
return "BAST" + type.substring(3) + number;
|
||||
if (type.startsWith("ALT")) // Anruf-Linien-Taxi
|
||||
return "BALT" + type.substring(3) + number;
|
||||
if (type.equals("ALFB")) // Anruf-Linien-Taxi
|
||||
return "BALFB" + number;
|
||||
if (type.equals("LTaxi"))
|
||||
return "BLTaxi" + number;
|
||||
if (type.equals("AT")) // AnschlußSammelTaxi
|
||||
return "BAT" + number;
|
||||
if (type.equals("SCH"))
|
||||
return "FSCH" + number;
|
||||
return newLine("B" + type.substring(3) + number);
|
||||
|
||||
final char normalizedType = normalizeType(type);
|
||||
if (normalizedType != 0)
|
||||
return newLine(normalizedType + type + number);
|
||||
|
||||
throw new IllegalStateException("cannot normalize type " + type + " number " + number + " line " + line);
|
||||
}
|
||||
|
||||
if ("11".equals(line))
|
||||
return "T11";
|
||||
return newLine("T11");
|
||||
if ("12".equals(line))
|
||||
return "T12";
|
||||
return newLine("T12");
|
||||
|
||||
throw new IllegalStateException("cannot normalize line " + line);
|
||||
}
|
||||
|
@ -401,6 +345,10 @@ public class RmvProvider extends AbstractHafasProvider
|
|||
if ("U-BAHN".equals(ucType))
|
||||
return 'U';
|
||||
|
||||
if ("B".equals(ucType))
|
||||
return 'B';
|
||||
if ("BuFB".equals(ucType))
|
||||
return 'B';
|
||||
if ("LTAXI".equals(ucType))
|
||||
return 'B';
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ package de.schildbach.pte;
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
@ -158,7 +159,7 @@ public class RtProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
protected String normalizeLine(final String line)
|
||||
protected Line normalizeLine(final String line)
|
||||
{
|
||||
return parseLineAndType(line);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ package de.schildbach.pte;
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
@ -154,7 +155,7 @@ public class SbbProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
protected String normalizeLine(final String line)
|
||||
protected Line normalizeLine(final String line)
|
||||
{
|
||||
return parseLineAndType(line);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ package de.schildbach.pte;
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
@ -145,7 +146,7 @@ public class SncbProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
protected String normalizeLine(final String line)
|
||||
protected Line normalizeLine(final String line)
|
||||
{
|
||||
return parseLineAndType(line);
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.util.List;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
@ -174,7 +175,7 @@ public class VbbProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
protected String normalizeLine(final String line)
|
||||
protected Line normalizeLine(final String line)
|
||||
{
|
||||
return parseLineAndType(line);
|
||||
}
|
||||
|
|
|
@ -170,8 +170,6 @@ public class VbnProvider extends AbstractHafasProvider
|
|||
return 'B';
|
||||
if ("RFTAST".equals(ucType))
|
||||
return 'B';
|
||||
if ("ALTN".equals(ucType))
|
||||
return 'B';
|
||||
|
||||
if ("BUSFÄHRE".equals(ucType)) // Blexen - Bremerhaven
|
||||
return 'F';
|
||||
|
|
|
@ -20,6 +20,7 @@ package de.schildbach.pte;
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
@ -162,7 +163,7 @@ public class ZvvProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
protected String normalizeLine(final String line)
|
||||
protected Line normalizeLine(final String line)
|
||||
{
|
||||
return parseLineAndType(line);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue