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:
andreas.schildbach@gmail.com 2012-02-12 20:37:34 +00:00
parent d888d6907f
commit 322f7eede7
18 changed files with 44 additions and 144 deletions

View file

@ -17,12 +17,6 @@
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
*/
@ -50,10 +44,4 @@ public class AvvProvider extends AbstractEfaProvider
return false;
}
@Override
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
}
}

View file

@ -17,12 +17,6 @@
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
*/
@ -49,10 +43,4 @@ public class BayernProvider extends AbstractEfaProvider
return false;
}
@Override
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
}
}

View file

@ -17,12 +17,6 @@
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
*/
@ -50,10 +44,4 @@ public class DingProvider extends AbstractEfaProvider
return false;
}
@Override
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
}
}

View file

@ -17,13 +17,9 @@
package de.schildbach.pte;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import de.schildbach.pte.dto.Location;
import de.schildbach.pte.dto.LocationType;
import de.schildbach.pte.dto.Style;
/**
@ -54,12 +50,6 @@ public class GvhProvider extends AbstractEfaProvider
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>();
static

View file

@ -17,12 +17,6 @@
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
*/
@ -50,10 +44,4 @@ public class IvbProvider extends AbstractEfaProvider
return false;
}
@Override
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
}
}

View file

@ -17,12 +17,6 @@
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
*/
@ -49,10 +43,4 @@ public class NphProvider extends AbstractEfaProvider
return false;
}
@Override
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
}
}

View file

@ -17,14 +17,10 @@
package de.schildbach.pte;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import de.schildbach.pte.dto.Location;
import de.schildbach.pte.dto.LocationType;
import de.schildbach.pte.dto.Style;
/**
@ -61,12 +57,6 @@ public class TflProvider extends AbstractEfaProvider
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>();
static

View file

@ -17,12 +17,6 @@
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
*/
@ -49,10 +43,4 @@ public class VblProvider extends AbstractEfaProvider
return false;
}
@Override
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
}
}

View file

@ -17,12 +17,6 @@
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
*
@ -51,10 +45,4 @@ public class VmobilProvider extends AbstractEfaProvider
return false;
}
@Override
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
}
}

View file

@ -17,12 +17,6 @@
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
*/
@ -50,10 +44,4 @@ public class VorProvider extends AbstractEfaProvider
return false;
}
@Override
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
}
}

View file

@ -17,12 +17,6 @@
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
*/
@ -50,10 +44,4 @@ public class VrnProvider extends AbstractEfaProvider
return false;
}
@Override
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
}
}

View file

@ -17,12 +17,6 @@
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
*/
@ -49,10 +43,4 @@ public class VvtProvider extends AbstractEfaProvider
return false;
}
@Override
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
}
}

View file

@ -70,6 +70,14 @@ public class DingProviderLiveTest extends AbstractProviderLiveTest
print(autocompletes);
}
@Test
public void autocompleteWithUmlaut() throws Exception
{
final List<Location> autocompletes = provider.autocompleteStations("grün");
print(autocompletes);
}
@Test
public void shortConnection() throws Exception
{

View file

@ -70,6 +70,14 @@ public class IvbProviderLiveTest extends AbstractProviderLiveTest
print(autocompletes);
}
@Test
public void autocompleteWithUmlaut() throws Exception
{
final List<Location> autocompletes = provider.autocompleteStations("grün");
print(autocompletes);
}
@Test
public void shortConnection() throws Exception
{

View file

@ -70,6 +70,14 @@ public class NphProviderLiveTest extends AbstractProviderLiveTest
print(autocompletes);
}
@Test
public void autocompleteWithUmlaut() throws Exception
{
final List<Location> autocompletes = provider.autocompleteStations("grün");
print(autocompletes);
}
@Test
public void shortConnection() throws Exception
{

View file

@ -70,6 +70,14 @@ public class VblProviderLiveTest extends AbstractProviderLiveTest
print(autocompletes);
}
@Test
public void autocompleteWithUmlaut() throws Exception
{
final List<Location> autocompletes = provider.autocompleteStations("grün");
print(autocompletes);
}
@Test
public void shortConnection() throws Exception
{

View file

@ -63,17 +63,17 @@ public class VrnProviderLiveTest extends AbstractProviderLiveTest
}
@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);
}
@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);
}

View file

@ -70,6 +70,14 @@ public class VvtProviderLiveTest extends AbstractProviderLiveTest
print(autocompletes);
}
@Test
public void autocompleteWithUmlaut() throws Exception
{
final List<Location> autocompletes = provider.autocompleteStations("grün");
print(autocompletes);
}
@Test
public void shortConnection() throws Exception
{