Changeset View
Changeset View
Standalone View
Standalone View
app/src/main/java/it/reyboz/bustorino/backend/gtfs/GtfsUtils.java
| Show All 15 Lines | BusTO - Backend components | ||||
| along with this program. If not, see <http://www.gnu.org/licenses/>. | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
| */ | */ | ||||
| package it.reyboz.bustorino.backend.gtfs; | package it.reyboz.bustorino.backend.gtfs; | ||||
| import androidx.core.util.Pair; | import androidx.core.util.Pair; | ||||
| import it.reyboz.bustorino.backend.ServiceType; | import it.reyboz.bustorino.backend.ServiceType; | ||||
| abstract public class GtfsUtils { | abstract public class GtfsUtils { | ||||
| public static String stripGtfsPrefix(String routeID){ | |||||
| String[] explo = routeID.split(":"); | |||||
| //default is | |||||
| String toParse = routeID; | |||||
| if(explo.length>1) { | |||||
| toParse = explo[1]; | |||||
| } | |||||
| return toParse; | |||||
| } | |||||
| public static Pair<ServiceType, String> getRouteInfoFromGTFS(String routeID){ | public static Pair<ServiceType, String> getRouteInfoFromGTFS(String routeID){ | ||||
| String[] explo = routeID.split(":"); | String[] explo = routeID.split(":"); | ||||
| //default is | //default is | ||||
| String toParse = routeID; | String toParse = routeID; | ||||
| if(explo.length>1) { | if(explo.length>1) { | ||||
| toParse = explo[1]; | toParse = explo[1]; | ||||
| } | } | ||||
| ServiceType serviceType=ServiceType.UNKNOWN; | ServiceType serviceType=ServiceType.UNKNOWN; | ||||
| Show All 31 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