當前位置: 首頁>>代碼示例>>Java>>正文


Java GRoute.getRouteShortName方法代碼示例

本文整理匯總了Java中org.mtransit.parser.gtfs.data.GRoute.getRouteShortName方法的典型用法代碼示例。如果您正苦於以下問題:Java GRoute.getRouteShortName方法的具體用法?Java GRoute.getRouteShortName怎麽用?Java GRoute.getRouteShortName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.mtransit.parser.gtfs.data.GRoute的用法示例。


在下文中一共展示了GRoute.getRouteShortName方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getRouteId

import org.mtransit.parser.gtfs.data.GRoute; //導入方法依賴的package包/類
@Override
public long getRouteId(GRoute gRoute) {
	if (R_WE_NF.equals(gRoute.getRouteId())) {
		return 14001l;
	} else if (R_WE_NOTL.equals(gRoute.getRouteId())) {
		return 14002l;
	} else if (R_PC001.equals(gRoute.getRouteId())) {
		return R_PC001_ID;
	} else if (R_PC002.equals(gRoute.getRouteId())) {
		return R_PC002_ID;
	} else if (R_WEPC.equals(gRoute.getRouteId())) {
		return R_WEPC_ID;
	} else if (R_WESC.equals(gRoute.getRouteId())) {
		return 19001l;
	} else if (gRoute.getRouteId().startsWith(R_WE0)) {
		if (gRoute.getRouteShortName() != null && gRoute.getRouteShortName().length() > 0 && Utils.isDigitsOnly(gRoute.getRouteShortName())) {
			return Long.parseLong(gRoute.getRouteShortName()); // using route short name as route ID
		}
	}
	System.out.printf("\nUnexpected route ID for %s!\n", gRoute);
	System.exit(-1);
	return -1l;
}
 
開發者ID:mtransitapps,項目名稱:ca-welland-transit-bus-parser,代碼行數:24,代碼來源:WellandTransitBusAgencyTools.java

示例2: getRouteShortName

import org.mtransit.parser.gtfs.data.GRoute; //導入方法依賴的package包/類
@Override
public String getRouteShortName(GRoute gRoute) {
	if (R_WE_NF.equals(gRoute.getRouteId())) {
		return NF;
	} else if (R_WE_NOTL.equals(gRoute.getRouteId())) {
		return NOTL;
	} else if (R_PC001.equals(gRoute.getRouteId())) {
		return PC1EAST;
	} else if (R_PC002.equals(gRoute.getRouteId())) {
		return PC2WEST;
	} else if (R_WEPC.equals(gRoute.getRouteId())) {
		return PCL;
	} else if (R_WESC.equals(gRoute.getRouteId())) {
		return BL;
	} else if (gRoute.getRouteId().startsWith(R_WE0)) {
		if (gRoute.getRouteShortName() != null && gRoute.getRouteShortName().length() > 0 && Utils.isDigitsOnly(gRoute.getRouteShortName())) {
			return gRoute.getRouteShortName();
		}
	}
	System.out.printf("\nUnexpected route short name for %s!\n", gRoute);
	System.exit(-1);
	return null;
}
 
開發者ID:mtransitapps,項目名稱:ca-welland-transit-bus-parser,代碼行數:24,代碼來源:WellandTransitBusAgencyTools.java

示例3: setTripHeadsign

import org.mtransit.parser.gtfs.data.GRoute; //導入方法依賴的package包/類
@Override
public void setTripHeadsign(MRoute mRoute, MTrip mTrip, GTrip gTrip, GSpec gtfs) {
	if (ALL_ROUTE_TRIPS2.containsKey(mRoute.getId())) {
		return; // split
	}
	GRoute gRoute = gtfs.getRoute(gTrip.getRouteId());
	String rsn = gRoute.getRouteShortName();
	String rsn_letter = rsn.substring(rsn.length() - 1, rsn.length());
	String tripHeadsign = rsn_letter + " " + getRouteLongName(gRoute);
	int directionId;
	if (A.equals(rsn_letter)) {
		directionId = 0;
	} else if (B.equals(rsn_letter)) {
		directionId = 1;
	} else {
		System.out.printf("\nUnexpected trip (unexpected rsn: %s): %s", rsn, gTrip);
		System.exit(-1);
		directionId = -1;
	}
	mTrip.setHeadsignString(cleanTripHeadsign(tripHeadsign), directionId);
}
 
開發者ID:mtransitapps,項目名稱:ca-barrie-transit-bus-parser,代碼行數:22,代碼來源:BarrieTransitBusAgencyTools.java

示例4: getRouteColor

import org.mtransit.parser.gtfs.data.GRoute; //導入方法依賴的package包/類
@Override
public String getRouteColor(GRoute gRoute) {
	if (R_WE_NF.equals(gRoute.getRouteId())) {
		return null;
	} else if (R_WE_NOTL.equals(gRoute.getRouteId())) {
		return null;
	} else if (R_PC001.equals(gRoute.getRouteId())) {
		return COLOR_F8A08A; // COLOR_ED1C24;
	} else if (R_PC002.equals(gRoute.getRouteId())) {
		return COLOR_A0C2E9; // COLOR_127BCA;
	} else if (R_WEPC.equals(gRoute.getRouteId())) {
		return COLOR_9E50AE;
	} else if (R_WESC.equals(gRoute.getRouteId())) {
		return null;
	} else if (gRoute.getRouteId().startsWith(R_WE0)) {
		if (gRoute.getRouteShortName() != null && gRoute.getRouteShortName().length() > 0 && Utils.isDigitsOnly(gRoute.getRouteShortName())) {
			int rsn = Integer.parseInt(gRoute.getRouteShortName());
			switch (rsn) {
			// @formatter:off
			case 1: return COLOR_ED1C24;
			case 2: return COLOR_A05843;
			case 3: return COLOR_00A990;
			case 4: return COLOR_2E3192;
			case 5: return COLOR_7B2178;
			case 6: return COLOR_19B5F1;
			case 8: return COLOR_EC008C;
			case 9: return COLOR_127BCA;
			case 10: return COLOR_F7903F; // "ED1C24";
			case 11: return COLOR_8CA2D7; // "2E3192";
			// @formatter:on
			}
		}

	}
	System.out.printf("\nUnexpected route color for %s!\n", gRoute);
	System.exit(-1);
	return null;
}
 
開發者ID:mtransitapps,項目名稱:ca-welland-transit-bus-parser,代碼行數:39,代碼來源:WellandTransitBusAgencyTools.java

示例5: getRouteShortName

import org.mtransit.parser.gtfs.data.GRoute; //導入方法依賴的package包/類
@Override
public String getRouteShortName(GRoute gRoute) {
	String routeShortName = gRoute.getRouteShortName(); // used by real-time API
	if (Utils.isDigitsOnly(routeShortName)) { // used by real-time API
		routeShortName = String.valueOf(Integer.valueOf(routeShortName)); // used by real-time API
	} // used by real-time API
	return routeShortName; // used by real-time API
}
 
開發者ID:mtransitapps,項目名稱:ca-vancouver-translink-bus-parser,代碼行數:9,代碼來源:VancouverTransLinkBusAgencyTools.java

示例6: getRouteId

import org.mtransit.parser.gtfs.data.GRoute; //導入方法依賴的package包/類
@Override
public long getRouteId(GRoute gRoute) {
	if (gRoute.getRouteShortName() != null && gRoute.getRouteShortName().length() > 0 && Utils.isDigitsOnly(gRoute.getRouteShortName())) {
		return Long.parseLong(gRoute.getRouteShortName()); // use route short name as route ID
	}
	int indexOf;
	indexOf = gRoute.getRouteShortName().indexOf(EB);
	if (indexOf >= 0) {
		return Long.parseLong(gRoute.getRouteShortName().substring(0, indexOf)); // use route short name as route ID
	}
	indexOf = gRoute.getRouteShortName().indexOf(WB);
	if (indexOf >= 0) {
		return Long.parseLong(gRoute.getRouteShortName().substring(0, indexOf)); // use route short name as route ID
	}
	indexOf = gRoute.getRouteShortName().indexOf(AM);
	if (indexOf >= 0) {
		return Long.parseLong(gRoute.getRouteShortName().substring(0, indexOf)); // use route short name as route ID
	}
	indexOf = gRoute.getRouteShortName().indexOf(PM);
	if (indexOf >= 0) {
		return Long.parseLong(gRoute.getRouteShortName().substring(0, indexOf)); // use route short name as route ID
	}
	Matcher matcher = DIGITS.matcher(gRoute.getRouteShortName());
	matcher.find();
	long id = Long.parseLong(matcher.group());
	if (gRoute.getRouteShortName().endsWith(A)) {
		return ROUTE_ID_ENDS_WITH_A + id;
	} else if (gRoute.getRouteShortName().endsWith(B)) {
		return ROUTE_ID_ENDS_WITH_B + id;
	}
	System.out.printf("\nUnexpected route ID for %s!\n", gRoute);
	System.exit(-1);
	return -1l;
}
 
開發者ID:mtransitapps,項目名稱:ca-milton-transit-bus-parser,代碼行數:35,代碼來源:MiltonTransitBusAgencyTools.java

示例7: getRouteShortName

import org.mtransit.parser.gtfs.data.GRoute; //導入方法依賴的package包/類
@Override
public String getRouteShortName(GRoute gRoute) {
	String routeShortName = gRoute.getRouteShortName();
	routeShortName = CLEAN_TAXI.matcher(routeShortName).replaceAll(CLEAN_TAXI_REPLACEMENT);
	return routeShortName;
}
 
開發者ID:mtransitapps,項目名稱:ca-le-richelain-citlr-bus-parser,代碼行數:7,代碼來源:LeRichelainCITLRBusAgencyTools.java


注:本文中的org.mtransit.parser.gtfs.data.GRoute.getRouteShortName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。