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

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

package org.opentripplanner.model;

import java.util.Arrays;
import java.util.EnumSet;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * 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 boolean onStreet() {
    return ON_STREET_MODES.contains(this);
  }

  public static Set transitModesExceptAirplane() {
    return NO_AIRPLANE_MODES;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy