Fix products for Luxembourg.

This commit is contained in:
Andreas Schildbach 2014-06-20 14:03:36 +02:00
parent e3108b8ea7
commit 3eed013c47

View file

@ -36,7 +36,7 @@ public class LuProvider extends AbstractHafasProvider
public LuProvider() public LuProvider()
{ {
super(API_BASE + "stboard.exe/fn", null, API_BASE + "query.exe/fn", 10, UTF_8, UTF_8); super(API_BASE + "stboard.exe/fn", null, API_BASE + "query.exe/fn", 9, UTF_8, UTF_8);
} }
public NetworkId id() public NetworkId id()
@ -53,6 +53,31 @@ public class LuProvider extends AbstractHafasProvider
return false; return false;
} }
@Override
protected char intToProduct(final int value)
{
if (value == 1)
return 'I';
if (value == 2)
return 'I';
if (value == 4)
return 'I';
if (value == 8)
return 'R';
if (value == 16)
return 'S';
if (value == 32)
return 'B';
if (value == 64)
return 'B';
if (value == 128)
return 'B';
if (value == 256)
return 'B';
throw new IllegalArgumentException("cannot handle: " + value);
}
@Override @Override
protected void setProductBits(final StringBuilder productBits, final Product product) protected void setProductBits(final StringBuilder productBits, final Product product)
{ {
@ -72,23 +97,22 @@ public class LuProvider extends AbstractHafasProvider
} }
else if (product == Product.SUBWAY) else if (product == Product.SUBWAY)
{ {
productBits.setCharAt(7, '1'); // U-Bahn
} }
else if (product == Product.TRAM) else if (product == Product.TRAM)
{ {
productBits.setCharAt(8, '1'); // Straßenbahn
} }
else if (product == Product.BUS) else if (product == Product.BUS)
{ {
productBits.setCharAt(5, '1'); // Bus productBits.setCharAt(5, '1');
productBits.setCharAt(6, '1');
productBits.setCharAt(7, '1');
productBits.setCharAt(8, '1');
} }
else if (product == Product.ON_DEMAND) else if (product == Product.ON_DEMAND)
{ {
productBits.setCharAt(9, '1'); // AST/Rufbus
} }
else if (product == Product.FERRY) else if (product == Product.FERRY)
{ {
productBits.setCharAt(6, '1'); // Schiff
} }
else if (product == Product.CABLECAR) else if (product == Product.CABLECAR)
{ {