mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 00:09:55 +00:00
use Product enum in queryConnections()
This commit is contained in:
parent
9653a0420f
commit
29f719db5a
97 changed files with 547 additions and 376 deletions
|
@ -24,6 +24,7 @@ import java.util.Locale;
|
|||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
|
@ -56,36 +57,36 @@ public class SbbProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void setProductBits(final StringBuilder productBits, final char product)
|
||||
protected void setProductBits(final StringBuilder productBits, final Product product)
|
||||
{
|
||||
if (product == 'I')
|
||||
if (product == Product.HIGH_SPEED_TRAIN)
|
||||
{
|
||||
productBits.setCharAt(0, '1'); // ICE/TGV/IRJ
|
||||
productBits.setCharAt(1, '1'); // EC/IC
|
||||
}
|
||||
else if (product == 'R')
|
||||
else if (product == Product.REGIONAL_TRAIN)
|
||||
{
|
||||
productBits.setCharAt(2, '1'); // IR
|
||||
productBits.setCharAt(3, '1'); // RE/D
|
||||
productBits.setCharAt(8, '1'); // ARZ/EXT
|
||||
}
|
||||
else if (product == 'S')
|
||||
else if (product == Product.SUBURBAN_TRAIN)
|
||||
{
|
||||
productBits.setCharAt(5, '1'); // S/SN/R
|
||||
}
|
||||
else if (product == 'U' || product == 'T')
|
||||
else if (product == Product.SUBWAY || product == Product.TRAM)
|
||||
{
|
||||
productBits.setCharAt(9, '1'); // Tram/Metro
|
||||
}
|
||||
else if (product == 'B' || product == 'P')
|
||||
else if (product == Product.BUS || product == Product.ON_DEMAND)
|
||||
{
|
||||
productBits.setCharAt(6, '1'); // Bus
|
||||
}
|
||||
else if (product == 'F')
|
||||
else if (product == Product.FERRY)
|
||||
{
|
||||
productBits.setCharAt(4, '1'); // Schiff
|
||||
}
|
||||
else if (product == 'C')
|
||||
else if (product == Product.CABLECAR)
|
||||
{
|
||||
productBits.setCharAt(7, '1'); // Seilbahn
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue