Package jmri
Enum SpeedStepMode
- All Implemented Interfaces:
Serializable,Comparable<SpeedStepMode>,java.lang.constant.Constable
DCC Speed Step Mode.
This file is part of JMRI.
This file is part of JMRI.
JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic SpeedStepModebestCompatibleMode(EnumSet<SpeedStepMode> command_station_modes, EnumSet<SpeedStepMode> decoder_modes) static SpeedStepModebestMode(EnumSet<SpeedStepMode> modes) static SpeedStepModegetByDescription(String name) Convert a localized name string to a DCC speed step mode.static SpeedStepModeConvert a human-readable string to a DCC speed step mode.static EnumSet<SpeedStepMode>getCompatibleModes(EnumSet<SpeedStepMode> command_station_modes, EnumSet<SpeedStepMode> decoder_modes) static EnumSet<SpeedStepMode>toString()Get a locale friendly Step Mode Description.static SpeedStepModeReturns the enum constant of this type with the specified name.static SpeedStepMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN
-
NMRA_DCC_128
-
NMRA_DCC_28
-
NMRA_DCC_27
-
NMRA_DCC_14
-
MOTOROLA_28
-
TMCC1_32
-
TMCC2_32
-
TMCC1_100
-
TMCC2_200
-
TMCC1TR_32
-
TMCC2TR_32
-
TMCC1TR_100
-
TMCC2TR_200
-
INCREMENTAL
-
-
Field Details
-
name
-
numSteps
The Number of steps, e.g. 126 for DCC 128 -
increment
The increment between steps, e.g. 1 / 126 for DCC 128 -
description
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
toString
Get a locale friendly Step Mode Description. For just "128" use name()- Overrides:
toStringin classEnum<SpeedStepMode>- Returns:
- e.g. "128 SS"
-
getByName
Convert a human-readable string to a DCC speed step mode.- Parameters:
name- string version of speed step mode; example "128"- Returns:
- matching SpeedStepMode
- Throws:
IllegalArgumentException- if name does not correspond to a valid speed step mode.
-
getByDescription
Convert a localized name string to a DCC speed step mode.- Parameters:
name- localized string version of speed step mode; example "128"- Returns:
- matching SpeedStepMode
- Throws:
IllegalArgumentException- if name does not correspond to a valid speed step mode.
-
getCompatibleModes
public static EnumSet<SpeedStepMode> getCompatibleModes(EnumSet<SpeedStepMode> command_station_modes, EnumSet<SpeedStepMode> decoder_modes) -
bestCompatibleMode
public static SpeedStepMode bestCompatibleMode(EnumSet<SpeedStepMode> command_station_modes, EnumSet<SpeedStepMode> decoder_modes) -
bestMode
-
getCompatibleModesForProtocol
-