mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 16:29:51 +00:00
'autocomplete one line' capability for all efa-based providers
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@565 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
65dec1fceb
commit
eeee8303a2
44 changed files with 210 additions and 53 deletions
|
@ -14,13 +14,17 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
|
@ -45,12 +49,18 @@ public class StvProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.DEPARTURES || capability == Capability.CONNECTIONS)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.CONNECTIONS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyLatLonUri(final int lat, final int lon)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue