本文整理匯總了Java中org.mtransit.parser.gtfs.data.GRoute類的典型用法代碼示例。如果您正苦於以下問題:Java GRoute類的具體用法?Java GRoute怎麽用?Java GRoute使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
GRoute類屬於org.mtransit.parser.gtfs.data包,在下文中一共展示了GRoute類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRouteColor
import org.mtransit.parser.gtfs.data.GRoute; //導入依賴的package包/類
@Override
public String getRouteColor(GRoute gRoute) {
if (StringUtils.isEmpty(gRoute.getRouteColor())) {
int rsn = Integer.parseInt(gRoute.getRouteShortName());
switch (rsn) {
// @formatter:off
case 1: return "0E4C89";
case 2: return "89C340";
case 3: return "F28020";
case 4: return "E81D8A";
case 5: return "28A8DF";
// @formatter:on
}
if (isGoodEnoughAccepted()) {
return null;
}
System.out.printf("\nUnexpected route color for %s!\n", gRoute);
System.exit(-1);
return null;
}
return super.getRouteColor(gRoute);
}
開發者ID:mtransitapps,項目名稱:ca-fort-st-john-transit-system-bus-parser,代碼行數:23,代碼來源:FortStJohnTransitSystemBusAgencyTools.java
示例2: getRouteColor
import org.mtransit.parser.gtfs.data.GRoute; //導入依賴的package包/類
@Override
public String getRouteColor(GRoute gRoute) {
if (StringUtils.isEmpty(gRoute.getRouteColor()) || "284384".equalsIgnoreCase(gRoute.getRouteColor())) {
int rsn = Integer.parseInt(gRoute.getRouteShortName());
switch (rsn) {
// @formatter:off
case 2: return "F68580";
case 3: return "F9A72B";
case 4: return "F03561";
case 5: return "F03561";
case 6: return "1C50A0";
case 7: return "E51535";
case 8: return "67218D";
case 12: return "1C6434";
case 17: return "40B93C";
case 18: return "72D2F7";
case 29: return "656263";
case 70: return "5A3716";
// @formatter:on
}
System.out.printf("\nUnexpected route color %s!\n", gRoute);
System.exit(-1);
return null;
}
return super.getRouteColor(gRoute);
}
開發者ID:mtransitapps,項目名稱:us-everett-transit-bus-parser,代碼行數:27,代碼來源:EverettTransitBusAgencyTools.java
示例3: 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
示例4: 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
示例5: getRouteId
import org.mtransit.parser.gtfs.data.GRoute; //導入依賴的package包/類
@Override
public long getRouteId(GRoute gRoute) {
if (Utils.isDigitsOnly(gRoute.getRouteShortName())) {
return Long.parseLong(gRoute.getRouteShortName()); // using route short name as route ID
}
Matcher matcher = DIGITS.matcher(gRoute.getRouteShortName());
if (matcher.find()) {
long digits = Long.parseLong(matcher.group());
if (gRoute.getRouteShortName().toLowerCase(Locale.ENGLISH).endsWith(N)) {
return RID_STARTS_WITH_N + digits;
} else if (gRoute.getRouteShortName().toLowerCase(Locale.ENGLISH).endsWith(S)) {
return RID_STARTS_WITH_S + digits;
}
}
System.out.printf("\nUnexpected route ID for %s!\n", gRoute);
System.exit(-1);
return -1l;
}
開發者ID:mtransitapps,項目名稱:ca-lethbridge-transit-bus-parser,代碼行數:19,代碼來源:LethbridgeTransitBusAgencyTools.java
示例6: getRouteShortName
import org.mtransit.parser.gtfs.data.GRoute; //導入依賴的package包/類
@Override
public String getRouteShortName(GRoute gRoute) {
if (StringUtils.isEmpty(gRoute.getRouteShortName())) {
if (RID_1.equals(gRoute.getRouteId())) {
return "MT QC S"; // Montréal - Québec ( Express )
} else if (RID_2.equals(gRoute.getRouteId())) {
return "MT YUL"; // Montréal - Aéroport Montréal-Trudeau
} else if (RID_3.equals(gRoute.getRouteId())) {
return "QC RK"; // Bas-Saint-Laurent
} else if (RID_4.equals(gRoute.getRouteId())) {
return "RK GS S"; // Gaspésie ( Côté Sud De La Péninsule )
} else if (RID_5.equals(gRoute.getRouteId())) {
return "RK GS N"; // Gaspésie ( Côté Nord De La Péninsule )
} else if (RID_6.equals(gRoute.getRouteId())) {
return "MT QC N"; // Montréal - Québec ( Mauricie )
} else if (RID_7.equals(gRoute.getRouteId())) {
return "MT VT"; // Centre-du-Québec
}
}
return super.getRouteShortName(gRoute);
}
開發者ID:mtransitapps,項目名稱:ca-quebec-orleans-express-bus-parser,代碼行數:22,代碼來源:QuebecOrleansExpressBusAgencyTools.java
示例7: getRouteId
import org.mtransit.parser.gtfs.data.GRoute; //導入依賴的package包/類
@Override
public long getRouteId(GRoute gRoute) {
if (Utils.isDigitsOnly(gRoute.getRouteId())) {
return Long.parseLong(gRoute.getRouteId());
}
Matcher matcher = DIGITS.matcher(gRoute.getRouteId());
matcher.find();
long id = Long.parseLong(matcher.group());
if (gRoute.getRouteId().startsWith(A)) {
return RID_A + id;
} else if (gRoute.getRouteId().startsWith(B)) {
return RID_B + id;
} else if (gRoute.getRouteId().startsWith(F)) {
return RID_F + id;
}
System.out.printf("\nUnexpected route ID %s!\n", gRoute);
System.exit(-1);
return -1l;
}
開發者ID:mtransitapps,項目名稱:ca-st-albert-transit-bus-parser,代碼行數:20,代碼來源:StAlbertTransitBusAgencyTools.java
示例8: getRouteColor
import org.mtransit.parser.gtfs.data.GRoute; //導入依賴的package包/類
@Override
public String getRouteColor(GRoute gRoute) {
if (StringUtils.isEmpty(gRoute.getRouteColor())) {
int rid = (int) getRouteId(gRoute);
switch (rid) {
// @formatter:off
case 10: return COLOR_75923C; // Dark Green
case 11: return COLOR_75923C; // Dark Green
case 12: return COLOR_4169E1; // Blue
case 13: return COLOR_4169E1; // Blue
case 14: return COLOR_E60000; // Red
case 15: return COLOR_E60000; // Red
case 16: return COLOR_32CD32; // Green
case 17: return COLOR_32CD32; // Green
case 18: return COLOR_996633; // Purple
case 20: return COLOR_996633; // Purple
case 116: return COLOR_4B0082; // Brown
case 216: return COLOR_4B0082; // Brown
// @formatter:on
}
System.out.printf("\nUnexpected route long name for %s!\n", gRoute);
System.exit(-1);
return null;
}
return super.getRouteColor(gRoute);
}
開發者ID:mtransitapps,項目名稱:ca-fredericton-transit-bus-parser,代碼行數:27,代碼來源:FrederictonTransitBusAgencyTools.java
示例9: getRouteColor
import org.mtransit.parser.gtfs.data.GRoute; //導入依賴的package包/類
@Override
public String getRouteColor(GRoute gRoute) {
if (RSN_1.equals(gRoute.getRouteShortName())) return COLOR_AAB41C;
if (RSN_2.equals(gRoute.getRouteShortName())) return COLOR_E680AD;
if (RSN_5.equals(gRoute.getRouteShortName())) return COLOR_A1A1A4;
if (RSN_6.equals(gRoute.getRouteShortName())) return COLOR_99CB9A;
if (RSN_8.equals(gRoute.getRouteShortName())) return COLOR_EF3B3A;
if (RSN_9.equals(gRoute.getRouteShortName())) return COLOR_E8B909;
if (RSN_11.equals(gRoute.getRouteShortName())) return COLOR_067650;
if (RSN_14.equals(gRoute.getRouteShortName())) return COLOR_1DA1DC;
if (RSN_15.equals(gRoute.getRouteShortName())) return COLOR_AAB41C;
if (RSN_100.equals(gRoute.getRouteShortName())) return COLOR_D68119;
if (RSN_101.equals(gRoute.getRouteShortName())) return COLOR_A686AA;
if (RSN_200.equals(gRoute.getRouteShortName())) return COLOR_A74232;
if (RSN_300.equals(gRoute.getRouteShortName())) return COLOR_FDE900;
if (RSN_400.equals(gRoute.getRouteShortName())) return COLOR_623F99;
return super.getRouteColor(gRoute);
}
開發者ID:mtransitapps,項目名稱:ca-l-assomption-mrclasso-bus-parser,代碼行數:19,代碼來源:LAssomptionMRCLASSOBusAgencyTools.java
示例10: getRouteColor
import org.mtransit.parser.gtfs.data.GRoute; //導入依賴的package包/類
@Override
public String getRouteColor(GRoute gRoute) {
if (StringUtils.isEmpty(gRoute.getRouteColor())) {
int rsn = Integer.parseInt(gRoute.getRouteShortName());
switch (rsn) {
// @formatter:off
case 1: return COLOR_E21735;
case 2: return COLOR_7FB539;
case 3: return COLOR_004A8F;
case 4: return COLOR_F78B1F;
case 5: return COLOR_52A6ED;
case 6: return COLOR_7C3F24;
case 7: return COLOR_A3238E;
case 8: return COLOR_49176D;
case 11: return COLOR_FCAF17;
// @formatter:on
default:
System.out.println("Unexpected route color " + gRoute);
System.exit(-1);
return null;
}
}
return super.getRouteColor(gRoute);
}
開發者ID:mtransitapps,項目名稱:ca-chilliwack-transit-system-bus-parser,代碼行數:25,代碼來源:ChilliwackTransitSystemBusAgencyTools.java
示例11: getRouteLongName
import org.mtransit.parser.gtfs.data.GRoute; //導入依賴的package包/類
@Override
public String getRouteLongName(GRoute gRoute) {
if (StringUtils.isEmpty(gRoute.getRouteLongName())) {
int rsn = Integer.parseInt(gRoute.getRouteShortName());
switch (rsn) {
// @formatter:off
case 1: return "Downtown / Southview & Country Club / Prairie Mall";
case 2: return "Downtown / Prairie Mall / Popular Dr & Countryside S";
case 3: return "Downtown / Prairie Mall / Eastlink Ctr";
case 4: return "Downtown / GPRC / Costco";
case 5: return "Lakeland & Crystal Lk / Prairie Mall / Royal Oaks & GPRC";
case 6: return "Westgate & Ctr W / Westpoite / Eastlink Ctr / GPRC";
case 7: return "Countryside S / Eastlink / O'Brien Lk / Signature Falls";
// @formatter:on
}
System.out.printf("\nUnexpected route long name %s!\n", gRoute);
System.exit(-1);
return null;
}
return super.getRouteLongName(gRoute);
}
開發者ID:mtransitapps,項目名稱:ca-grande-prairie-transit-bus-parser,代碼行數:22,代碼來源:GrandePrairieTransitBusAgencyTools.java
示例12: getRouteShortName
import org.mtransit.parser.gtfs.data.GRoute; //導入依賴的package包/類
@Override
public String getRouteShortName(GRoute gRoute) {
if (Utils.isDigitsOnly(gRoute.getRouteShortName())) {
int rsn = Integer.parseInt(gRoute.getRouteShortName());
switch (rsn) {
// @formatter:off
case 300: return RSN_RED; // Red
case 301: return RSN_BLUE; // Blue
case 302: return RSN_GREEN; // Green
// @formatter:on
default:
System.out.printf("\nUnexpected route long name for %s!\n", gRoute);
System.exit(-1);
return null;
}
}
return super.getRouteShortName(gRoute); // used by real-time API
}
開發者ID:mtransitapps,項目名稱:ca-niagara-falls-wego-bus-parser,代碼行數:19,代碼來源:NiagaraFallsWEGOBusAgencyTools.java
示例13: getRouteShortName
import org.mtransit.parser.gtfs.data.GRoute; //導入依賴的package包/類
@Override
public String getRouteShortName(GRoute gRoute) {
if (StringUtils.isEmpty(gRoute.getRouteShortName())) {
if (gRoute.getRouteId().endsWith(ST_RSN)) {
return ST_RSN;
} else if (gRoute.getRouteId().endsWith(RH_RSN)) {
return RH_RSN;
} else if (gRoute.getRouteId().endsWith(MI_RSN)) {
return MI_RSN;
} else if (gRoute.getRouteId().endsWith(LW_RSN)) {
return LW_RSN;
} else if (gRoute.getRouteId().endsWith(LE_RSN)) {
return LE_RSN;
} else if (gRoute.getRouteId().endsWith(KI_RSN) //
|| gRoute.getRouteId().endsWith(GT_RSN)) {
return GT_RSN;
} else if (gRoute.getRouteId().endsWith(BR_RSN)) {
return BR_RSN;
}
System.out.printf("\nUnexpected route short name for %s!\n", gRoute);
System.exit(-1);
return null;
}
return super.getRouteShortName(gRoute);
}
開發者ID:mtransitapps,項目名稱:ca-gtha-go-transit-train-parser,代碼行數:26,代碼來源:GTHAGOTransitTrainAgencyTools.java
示例14: getRouteId
import org.mtransit.parser.gtfs.data.GRoute; //導入依賴的package包/類
@Override
public long getRouteId(GRoute gRoute) {
if (Utils.isDigitsOnly(gRoute.getRouteShortName())) {
return Long.parseLong(gRoute.getRouteShortName());
}
Matcher matcher = DIGITS.matcher(gRoute.getRouteShortName());
if (matcher.find()) {
int digits = Integer.parseInt(matcher.group());
if (gRoute.getRouteShortName().endsWith(B)) {
return RID_ENDS_WITH_B + digits;
}
}
System.out.printf("\nCan't find route ID for %s!\n", gRoute);
System.exit(-1);
return -1l;
}
開發者ID:mtransitapps,項目名稱:ca-banff-roam-transit-bus-parser,代碼行數:17,代碼來源:BanffRoamTransitBusAgencyTools.java
示例15: getRouteColor
import org.mtransit.parser.gtfs.data.GRoute; //導入依賴的package包/類
@Override
public String getRouteColor(GRoute gRoute) {
Matcher matcher = DIGITS.matcher(gRoute.getRouteShortName());
matcher.find();
int routeId = Integer.parseInt(matcher.group());
switch (routeId) {
// @formatter:off
case 1: return COLOR_EC008C;
case 2: return COLOR_ED1C24;
case 3: return COLOR_0089CF;
case 4: return COLOR_918BC3;
case 5: return COLOR_8ED8F8;
case 6: return COLOR_B2D235;
case 7: return COLOR_F58220;
case 8: return COLOR_000000;
case 11: return COLOR_FFFF00;
case 90: return COLOR_007236;
// @formatter:on
}
System.out.printf("\nUnexpected route color %s!", gRoute);
System.exit(-1);
return null;
}