mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 08:49:58 +00:00
support product selection for XML API based connection queries
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@706 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
f442cd5ead
commit
e10e60cb41
22 changed files with 630 additions and 5 deletions
|
@ -53,6 +53,46 @@ public class NriProvider extends AbstractHafasProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setProductBits(final StringBuilder productBits, final char product)
|
||||
{
|
||||
if (product == 'I')
|
||||
{
|
||||
productBits.setCharAt(0, '1'); // Flugzeug
|
||||
}
|
||||
else if (product == 'R')
|
||||
{
|
||||
productBits.setCharAt(1, '1'); // Regionalverkehrszug
|
||||
productBits.setCharAt(7, '1'); // Tourismus-Züge
|
||||
productBits.setCharAt(2, '1'); // undokumentiert
|
||||
}
|
||||
else if (product == 'S' || product == 'T')
|
||||
{
|
||||
productBits.setCharAt(3, '1'); // Stadtbahn
|
||||
}
|
||||
else if (product == 'U')
|
||||
{
|
||||
productBits.setCharAt(4, '1'); // U-Bahn
|
||||
}
|
||||
else if (product == 'B' || product == 'P')
|
||||
{
|
||||
productBits.setCharAt(2, '1'); // Bus
|
||||
}
|
||||
else if (product == 'F')
|
||||
{
|
||||
productBits.setCharAt(5, '1'); // Express-Boot
|
||||
productBits.setCharAt(6, '1'); // Schiff
|
||||
productBits.setCharAt(7, '1'); // Fähre
|
||||
}
|
||||
else if (product == 'C')
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot handle: " + product);
|
||||
}
|
||||
}
|
||||
|
||||
private static final String[] PLACES = { "Oslo", "Bergen" };
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue