mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-21 01:39:51 +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
|
@ -20,6 +20,7 @@ package de.schildbach.pte;
|
|||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
|
@ -37,6 +38,7 @@ import de.schildbach.pte.dto.Location;
|
|||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.Point;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryConnectionsContext;
|
||||
import de.schildbach.pte.dto.QueryConnectionsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
@ -106,41 +108,41 @@ public final class BvgProvider 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(5, '1');
|
||||
}
|
||||
else if (product == 'R')
|
||||
else if (product == Product.REGIONAL_TRAIN)
|
||||
{
|
||||
productBits.setCharAt(6, '1');
|
||||
}
|
||||
else if (product == 'S')
|
||||
else if (product == Product.SUBURBAN_TRAIN)
|
||||
{
|
||||
productBits.setCharAt(0, '1');
|
||||
}
|
||||
else if (product == 'U')
|
||||
else if (product == Product.SUBWAY)
|
||||
{
|
||||
productBits.setCharAt(1, '1');
|
||||
}
|
||||
else if (product == 'T')
|
||||
else if (product == Product.TRAM)
|
||||
{
|
||||
productBits.setCharAt(2, '1');
|
||||
}
|
||||
else if (product == 'B')
|
||||
else if (product == Product.BUS)
|
||||
{
|
||||
productBits.setCharAt(3, '1');
|
||||
}
|
||||
else if (product == 'P')
|
||||
else if (product == Product.ON_DEMAND)
|
||||
{
|
||||
productBits.setCharAt(7, '1');
|
||||
}
|
||||
else if (product == 'F')
|
||||
else if (product == Product.FERRY)
|
||||
{
|
||||
productBits.setCharAt(4, '1');
|
||||
}
|
||||
else if (product == 'C')
|
||||
else if (product == Product.CABLECAR)
|
||||
{
|
||||
}
|
||||
else
|
||||
|
@ -527,7 +529,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
|
||||
@Override
|
||||
public QueryConnectionsResult queryConnections(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final int maxNumConnections, final String products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
||||
final int maxNumConnections, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
||||
final Set<Option> options) throws IOException
|
||||
{
|
||||
return queryConnectionsBinary(from, via, to, date, dep, maxNumConnections, products, walkSpeed, accessibility, options);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue