Class ProgrammingMode
- java.lang.Object
-
- jmri.ProgrammingMode
-
@Immutable public final class ProgrammingMode extends java.lang.Object
Denote a single programming mode.User code gets a list of available modes from the
ProgrammerorAddressedProgrammerin use. It then selects a mode to use and indicates it via a setMode() call.A ProgrammingMode has a user-readable name to help humans select it.
We define a number of modes as constants because they are common across so many DCC-specific implementations, they've become defacto standards.
More specific definitions (and Bundle entries) should retreat to specific Programmer implementations. The whole idea is to have code deal with the modes that a specific
Programmerprovides, not make assumptions about global values.- See Also:
Programmer
-
-
Field Summary
Fields Modifier and Type Field Description static ProgrammingModeADDRESSMODENMRA "Address-only" mode.static ProgrammingModeDIRECTBITMODENMRA "Direct" mode, using only the bit-wise operations.static ProgrammingModeDIRECTBYTEMODENMRA "Direct" mode, using only the byte-wise operations.static ProgrammingModeDIRECTMODENMRA "Direct" mode, using both the bit-wise and byte-wise operations.static ProgrammingModeOPSACCBITMODENMRA "Programming on the main" mode for stationary decoders, using only the bit-wise operations.static ProgrammingModeOPSACCBYTEMODENMRA "Programming on the main" mode for stationary decoders, using only the byte-wise operations.static ProgrammingModeOPSACCEXTBITMODENMRA "Programming on the main" mode for stationary decoders, using only the bit-wise operations and "extended" addressing.static ProgrammingModeOPSACCEXTBYTEMODENMRA "Programming on the main" mode for stationary decoders, using only the byte-wise operations and "extended" addressing.static ProgrammingModeOPSBITMODENMRA "Operations" or "Programming on the main" mode, using only the bit-wise operationsstatic ProgrammingModeOPSBYTEMODENMRA "Operations" or "Programming on the main" mode, using only the byte-wise operations.static ProgrammingModePAGEMODENMRA "Paged" modestatic ProgrammingModeREGISTERMODENMRA "Register" mode.
-
Constructor Summary
Constructors Constructor Description ProgrammingMode(java.lang.String standardName)Create a ProgrammingMode instance.ProgrammingMode(java.lang.String standardName, java.lang.String localName)Create an instance with a provided localized name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.StringgetStandardName()Return the standard (not localized, human readable) name.inthashCode()java.lang.StringtoString()Display the localized (human readable) name.
-
-
-
Field Detail
-
PAGEMODE
public static final ProgrammingMode PAGEMODE
NMRA "Paged" mode
-
OPSBITMODE
public static final ProgrammingMode OPSBITMODE
NMRA "Operations" or "Programming on the main" mode, using only the bit-wise operations
-
OPSACCEXTBYTEMODE
public static final ProgrammingMode OPSACCEXTBYTEMODE
NMRA "Programming on the main" mode for stationary decoders, using only the byte-wise operations and "extended" addressing.
-
OPSACCBITMODE
public static final ProgrammingMode OPSACCBITMODE
NMRA "Programming on the main" mode for stationary decoders, using only the bit-wise operations. Note that this is defined as using the "normal", not "extended" addressing.
-
OPSACCEXTBITMODE
public static final ProgrammingMode OPSACCEXTBITMODE
NMRA "Programming on the main" mode for stationary decoders, using only the bit-wise operations and "extended" addressing.
-
OPSACCBYTEMODE
public static final ProgrammingMode OPSACCBYTEMODE
NMRA "Programming on the main" mode for stationary decoders, using only the byte-wise operations. Note that this is defined as using the "normal", not "extended" addressing.
-
ADDRESSMODE
public static final ProgrammingMode ADDRESSMODE
NMRA "Address-only" mode. Often implemented as a proper subset of "Register" mode, as the underlying operation is the same.
-
OPSBYTEMODE
public static final ProgrammingMode OPSBYTEMODE
NMRA "Operations" or "Programming on the main" mode, using only the byte-wise operations.
-
DIRECTBYTEMODE
public static final ProgrammingMode DIRECTBYTEMODE
NMRA "Direct" mode, using only the byte-wise operations.
-
REGISTERMODE
public static final ProgrammingMode REGISTERMODE
NMRA "Register" mode.
-
DIRECTBITMODE
public static final ProgrammingMode DIRECTBITMODE
NMRA "Direct" mode, using only the bit-wise operations.
-
DIRECTMODE
public static final ProgrammingMode DIRECTMODE
NMRA "Direct" mode, using both the bit-wise and byte-wise operations.
-
-
Constructor Detail
-
ProgrammingMode
public ProgrammingMode(@Nonnull java.lang.String standardName)
Create a ProgrammingMode instance.- Parameters:
standardName- a name, not to be translated, for internal use
-
ProgrammingMode
public ProgrammingMode(@Nonnull java.lang.String standardName, @Nonnull java.lang.String localName)
Create an instance with a provided localized name.This is useful when creating a ProgrammingMode deep within some system-specific code, and translations cannot be added to the top-level jmri.Bundle.
- Parameters:
standardName- a name, not to be translated, for internal uselocalName- a localized, human-readable name for the mode
-
-
Method Detail
-
toString
@Nonnull public java.lang.String toString()
Display the localized (human readable) name.- Overrides:
toStringin classjava.lang.Object- Returns:
- the localized name
-
getStandardName
@Nonnull public java.lang.String getStandardName()
Return the standard (not localized, human readable) name.- Returns:
- the standard name
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-