mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-12 22:28:48 +00:00
Mersey: Line.
This commit is contained in:
parent
96b10d4314
commit
e2f39f2d8f
1 changed files with 17 additions and 0 deletions
|
@ -21,6 +21,11 @@ import java.util.Set;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Position;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
|
||||
|
@ -42,6 +47,18 @@ public class MerseyProvider extends AbstractEfaProvider {
|
|||
return Product.ALL;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Line parseLine(final @Nullable String id, final @Nullable String network, final @Nullable String mot,
|
||||
final @Nullable String symbol, final @Nullable String name, final @Nullable String longName,
|
||||
final @Nullable String trainType, final @Nullable String trainNum, final @Nullable String trainName) {
|
||||
if ("13".equals(mot)) {
|
||||
if ("OO".equals(trainType) || "Ordinary passenger (o.pas.)".equals(trainName))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "OO" + Strings.nullToEmpty(trainNum));
|
||||
}
|
||||
|
||||
return super.parseLine(id, network, mot, symbol, name, longName, trainType, trainNum, trainName);
|
||||
}
|
||||
|
||||
private static final Pattern P_POSITION_BOUND = Pattern.compile("([NESW]+)-bound", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue