mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 06:08:52 +00:00
use JSON for autocomplete where possible
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@941 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
d888d6907f
commit
322f7eede7
18 changed files with 44 additions and 144 deletions
|
@ -17,12 +17,6 @@
|
||||||
|
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Location;
|
|
||||||
import de.schildbach.pte.dto.LocationType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andreas Schildbach
|
* @author Andreas Schildbach
|
||||||
*/
|
*/
|
||||||
|
@ -50,10 +44,4 @@ public class AvvProvider extends AbstractEfaProvider
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
|
||||||
{
|
|
||||||
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,6 @@
|
||||||
|
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Location;
|
|
||||||
import de.schildbach.pte.dto.LocationType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andreas Schildbach
|
* @author Andreas Schildbach
|
||||||
*/
|
*/
|
||||||
|
@ -49,10 +43,4 @@ public class BayernProvider extends AbstractEfaProvider
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
|
||||||
{
|
|
||||||
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,6 @@
|
||||||
|
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Location;
|
|
||||||
import de.schildbach.pte.dto.LocationType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andreas Schildbach
|
* @author Andreas Schildbach
|
||||||
*/
|
*/
|
||||||
|
@ -50,10 +44,4 @@ public class DingProvider extends AbstractEfaProvider
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
|
||||||
{
|
|
||||||
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,13 +17,9 @@
|
||||||
|
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Location;
|
|
||||||
import de.schildbach.pte.dto.LocationType;
|
|
||||||
import de.schildbach.pte.dto.Style;
|
import de.schildbach.pte.dto.Style;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,12 +50,6 @@ public class GvhProvider extends AbstractEfaProvider
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
|
||||||
{
|
|
||||||
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final Map<String, Style> LINES = new HashMap<String, Style>();
|
private static final Map<String, Style> LINES = new HashMap<String, Style>();
|
||||||
|
|
||||||
static
|
static
|
||||||
|
|
|
@ -17,12 +17,6 @@
|
||||||
|
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Location;
|
|
||||||
import de.schildbach.pte.dto.LocationType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andreas Schildbach
|
* @author Andreas Schildbach
|
||||||
*/
|
*/
|
||||||
|
@ -50,10 +44,4 @@ public class IvbProvider extends AbstractEfaProvider
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
|
||||||
{
|
|
||||||
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,6 @@
|
||||||
|
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Location;
|
|
||||||
import de.schildbach.pte.dto.LocationType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andreas Schildbach
|
* @author Andreas Schildbach
|
||||||
*/
|
*/
|
||||||
|
@ -49,10 +43,4 @@ public class NphProvider extends AbstractEfaProvider
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
|
||||||
{
|
|
||||||
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,14 +17,10 @@
|
||||||
|
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Location;
|
|
||||||
import de.schildbach.pte.dto.LocationType;
|
|
||||||
import de.schildbach.pte.dto.Style;
|
import de.schildbach.pte.dto.Style;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,12 +57,6 @@ public class TflProvider extends AbstractEfaProvider
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
|
||||||
{
|
|
||||||
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final Map<String, Style> LINES = new HashMap<String, Style>();
|
private static final Map<String, Style> LINES = new HashMap<String, Style>();
|
||||||
|
|
||||||
static
|
static
|
||||||
|
|
|
@ -17,12 +17,6 @@
|
||||||
|
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Location;
|
|
||||||
import de.schildbach.pte.dto.LocationType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andreas Schildbach
|
* @author Andreas Schildbach
|
||||||
*/
|
*/
|
||||||
|
@ -49,10 +43,4 @@ public class VblProvider extends AbstractEfaProvider
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
|
||||||
{
|
|
||||||
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,6 @@
|
||||||
|
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Location;
|
|
||||||
import de.schildbach.pte.dto.LocationType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verkehrsverbund Vorarlberg
|
* Verkehrsverbund Vorarlberg
|
||||||
*
|
*
|
||||||
|
@ -51,10 +45,4 @@ public class VmobilProvider extends AbstractEfaProvider
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
|
||||||
{
|
|
||||||
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,6 @@
|
||||||
|
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Location;
|
|
||||||
import de.schildbach.pte.dto.LocationType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andreas Schildbach
|
* @author Andreas Schildbach
|
||||||
*/
|
*/
|
||||||
|
@ -50,10 +44,4 @@ public class VorProvider extends AbstractEfaProvider
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
|
||||||
{
|
|
||||||
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,6 @@
|
||||||
|
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Location;
|
|
||||||
import de.schildbach.pte.dto.LocationType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andreas Schildbach
|
* @author Andreas Schildbach
|
||||||
*/
|
*/
|
||||||
|
@ -50,10 +44,4 @@ public class VrnProvider extends AbstractEfaProvider
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
|
||||||
{
|
|
||||||
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,6 @@
|
||||||
|
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Location;
|
|
||||||
import de.schildbach.pte.dto.LocationType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andreas Schildbach
|
* @author Andreas Schildbach
|
||||||
*/
|
*/
|
||||||
|
@ -49,10 +43,4 @@ public class VvtProvider extends AbstractEfaProvider
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
|
||||||
{
|
|
||||||
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,14 @@ public class DingProviderLiveTest extends AbstractProviderLiveTest
|
||||||
print(autocompletes);
|
print(autocompletes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void autocompleteWithUmlaut() throws Exception
|
||||||
|
{
|
||||||
|
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||||
|
|
||||||
|
print(autocompletes);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shortConnection() throws Exception
|
public void shortConnection() throws Exception
|
||||||
{
|
{
|
||||||
|
|
|
@ -70,6 +70,14 @@ public class IvbProviderLiveTest extends AbstractProviderLiveTest
|
||||||
print(autocompletes);
|
print(autocompletes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void autocompleteWithUmlaut() throws Exception
|
||||||
|
{
|
||||||
|
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||||
|
|
||||||
|
print(autocompletes);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shortConnection() throws Exception
|
public void shortConnection() throws Exception
|
||||||
{
|
{
|
||||||
|
|
|
@ -70,6 +70,14 @@ public class NphProviderLiveTest extends AbstractProviderLiveTest
|
||||||
print(autocompletes);
|
print(autocompletes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void autocompleteWithUmlaut() throws Exception
|
||||||
|
{
|
||||||
|
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||||
|
|
||||||
|
print(autocompletes);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shortConnection() throws Exception
|
public void shortConnection() throws Exception
|
||||||
{
|
{
|
||||||
|
|
|
@ -70,6 +70,14 @@ public class VblProviderLiveTest extends AbstractProviderLiveTest
|
||||||
print(autocompletes);
|
print(autocompletes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void autocompleteWithUmlaut() throws Exception
|
||||||
|
{
|
||||||
|
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||||
|
|
||||||
|
print(autocompletes);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shortConnection() throws Exception
|
public void shortConnection() throws Exception
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,17 +63,17 @@ public class VrnProviderLiveTest extends AbstractProviderLiveTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void autocompleteWithUmlaut() throws Exception
|
public void autocompleteIncomplete() throws Exception
|
||||||
{
|
{
|
||||||
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||||
|
|
||||||
print(autocompletes);
|
print(autocompletes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void autocompleteIncomplete() throws Exception
|
public void autocompleteWithUmlaut() throws Exception
|
||||||
{
|
{
|
||||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||||
|
|
||||||
print(autocompletes);
|
print(autocompletes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,14 @@ public class VvtProviderLiveTest extends AbstractProviderLiveTest
|
||||||
print(autocompletes);
|
print(autocompletes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void autocompleteWithUmlaut() throws Exception
|
||||||
|
{
|
||||||
|
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||||
|
|
||||||
|
print(autocompletes);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shortConnection() throws Exception
|
public void shortConnection() throws Exception
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue