use Product enum in queryConnections()

This commit is contained in:
Andreas Schildbach 2013-03-15 10:13:35 +01:00
parent 9653a0420f
commit 29f719db5a
97 changed files with 547 additions and 376 deletions

View file

@ -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;
@ -78,37 +79,37 @@ public class NriProvider 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'); // Flugzeug
}
else if (product == 'R')
else if (product == Product.REGIONAL_TRAIN)
{
productBits.setCharAt(1, '1'); // Regionalverkehrszug
productBits.setCharAt(7, '1'); // Tourismus-Züge
productBits.setCharAt(2, '1'); // undokumentiert
}
else if (product == 'S' || product == 'T')
else if (product == Product.SUBURBAN_TRAIN || product == Product.TRAM)
{
productBits.setCharAt(3, '1'); // Stadtbahn
}
else if (product == 'U')
else if (product == Product.SUBWAY)
{
productBits.setCharAt(4, '1'); // U-Bahn
}
else if (product == 'B' || product == 'P')
else if (product == Product.BUS || product == Product.ON_DEMAND)
{
productBits.setCharAt(2, '1'); // Bus
}
else if (product == 'F')
else if (product == Product.FERRY)
{
productBits.setCharAt(5, '1'); // Express-Boot
productBits.setCharAt(6, '1'); // Schiff
productBits.setCharAt(7, '1'); // Fähre
}
else if (product == 'C')
else if (product == Product.CABLECAR)
{
}
else