mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 18:49:51 +00:00
fixed product resolution and json encoding
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@900 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
26b2281fbd
commit
3c8f712b6a
1 changed files with 28 additions and 1 deletions
|
@ -37,7 +37,7 @@ public class ZvvProvider extends AbstractHafasProvider
|
|||
|
||||
public ZvvProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/dn", 10, null, null, "UTF-8");
|
||||
super(API_BASE + "query.exe/dn", 10, null, "UTF-8", "UTF-8");
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -54,6 +54,33 @@ public class ZvvProvider extends AbstractHafasProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected char intToProduct(final int value)
|
||||
{
|
||||
if (value == 1)
|
||||
return 'I';
|
||||
if (value == 2)
|
||||
return 'I';
|
||||
if (value == 4)
|
||||
return 'R';
|
||||
if (value == 8)
|
||||
return 'R';
|
||||
if (value == 16)
|
||||
return 'F';
|
||||
if (value == 32)
|
||||
return 'S';
|
||||
if (value == 64)
|
||||
return 'B';
|
||||
if (value == 128)
|
||||
return 'C';
|
||||
if (value == 256)
|
||||
return 'U';
|
||||
if (value == 512)
|
||||
return 'T';
|
||||
|
||||
throw new IllegalArgumentException("cannot handle: " + value);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setProductBits(final StringBuilder productBits, final char product)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue