Enum Class TransitMode

java.lang.Object
java.lang.Enum<TransitMode>
com.cta4j.bus.vehicle.model.TransitMode
All Implemented Interfaces:
Serializable, Comparable<TransitMode>, Constable

public enum TransitMode extends Enum<TransitMode>
Represents the mode of transit for a vehicle.
  • Enum Constant Details

    • NONE

      public static final TransitMode NONE
      Indicates no specific transit mode.
    • BUS

      public static final TransitMode BUS
      Indicates a bus transit mode.
    • FERRY

      public static final TransitMode FERRY
      Indicates a ferry transit mode.
    • RAIL

      public static final TransitMode RAIL
      Indicates a rail transit mode.
    • PEOPLE_MOVER

      public static final TransitMode PEOPLE_MOVER
      Indicates a people mover transit mode.
  • Method Details

    • values

      public static TransitMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TransitMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getCode

      public int getCode()
      Gets the code associated with this transit mode.
      Returns:
      the transit mode code
    • fromCode

      public static TransitMode fromCode(int code)
      Returns the TransitMode corresponding to the given code.
      Parameters:
      code - the transit mode code
      Returns:
      the corresponding TransitMode
      Throws:
      IllegalArgumentException - if the code does not correspond to any known transit mode