Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/data/StopsDB.java
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | public List<String> getRoutesByStop(@NonNull String stopID) { | ||||
routes.add(result.getString(0)); | routes.add(result.getString(0)); | ||||
} | } | ||||
result.close(); | result.close(); | ||||
return routes; | return routes; | ||||
} | } | ||||
public String getNameFromID(@NonNull String stopID) { | |||||
String[] uselessArray = {stopID}; | |||||
int count; | |||||
String name; | |||||
Cursor result; | |||||
if(this.db == null) { | |||||
return null; | |||||
} | |||||
try { | |||||
result = this.db.query(QUERY_TABLE_stops, QUERY_COLUMN_name, QUERY_WHERE_ID, uselessArray, null, null, null); | |||||
} catch(SQLiteException e) { | |||||
return null; | |||||
} | |||||
count = result.getCount(); | |||||
if(count == 0) { | |||||
return null; | |||||
} | |||||
result.moveToNext(); | |||||
name = result.getString(0); | |||||
result.close(); | |||||
return name; | |||||
} | |||||
public String getLocationFromID(@NonNull String stopID) { | public String getLocationFromID(@NonNull String stopID) { | ||||
String[] uselessArray = {stopID}; | String[] uselessArray = {stopID}; | ||||
int count; | int count; | ||||
String name; | String name; | ||||
Cursor result; | Cursor result; | ||||
if(this.db == null) { | if(this.db == null) { | ||||
return null; | return null; | ||||
▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register