Package com.cta4j.bus.vehicle.model
Enum Class TransitMode
- All Implemented Interfaces:
Serializable,Comparable<TransitMode>,Constable
Represents the mode of transit for a vehicle.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIndicates a bus transit mode.Indicates a ferry transit mode.Indicates no specific transit mode.Indicates a people mover transit mode.Indicates a rail transit mode. -
Method Summary
Modifier and TypeMethodDescriptionstatic TransitModefromCode(int code) Returns theTransitModecorresponding to the given code.intgetCode()Gets the code associated with this transit mode.static TransitModeReturns the enum constant of this class with the specified name.static TransitMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
Indicates no specific transit mode. -
BUS
Indicates a bus transit mode. -
FERRY
Indicates a ferry transit mode. -
RAIL
Indicates a rail transit mode. -
PEOPLE_MOVER
Indicates a people mover transit mode.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getCode
public int getCode()Gets the code associated with this transit mode.- Returns:
- the transit mode code
-
fromCode
Returns theTransitModecorresponding 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
-