All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentripplanner.transit.model.basic.TransitMode Maven / Gradle / Ivy

There is a newer version: 2.6.0
Show newest version
package org.opentripplanner.transit.model.basic;

import java.util.EnumSet;
import java.util.Set;

/**
 * Equivalent to GTFS route_type or to NeTEx TransportMode.
 */
public enum TransitMode {
  RAIL,
  COACH,
  SUBWAY,
  BUS,
  TRAM,
  FERRY,
  AIRPLANE,
  CABLE_CAR,
  GONDOLA,
  FUNICULAR,
  TROLLEYBUS,
  MONORAIL;

  private static final Set ON_STREET_MODES = EnumSet.of(COACH, BUS, TROLLEYBUS);
  private static final Set NO_AIRPLANE_MODES = EnumSet.complementOf(
    EnumSet.of(AIRPLANE)
  );

  public static Set transitModesExceptAirplane() {
    return NO_AIRPLANE_MODES;
  }

  public boolean onStreet() {
    return ON_STREET_MODES.contains(this);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy