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
Programmer
orAddressedProgrammer
in 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
Programmer
provides, not make assumptions about global values.- See Also:
Programmer
-
-
Field Summary
Fields Modifier and Type Field Description static ProgrammingMode
ADDRESSMODE
NMRA "Address-only" mode.static ProgrammingMode
DIRECTBITMODE
NMRA "Direct" mode, using only the bit-wise operations.static ProgrammingMode
DIRECTBYTEMODE
NMRA "Direct" mode, using only the byte-wise operations.static ProgrammingMode
DIRECTMODE
NMRA "Direct" mode, using both the bit-wise and byte-wise operations.static ProgrammingMode
OPSACCBITMODE
NMRA "Programming on the main" mode for stationary decoders, using only the bit-wise operations.static ProgrammingMode
OPSACCBYTEMODE
NMRA "Programming on the main" mode for stationary decoders, using only the byte-wise operations.static ProgrammingMode
OPSACCEXTBITMODE
NMRA "Programming on the main" mode for stationary decoders, using only the bit-wise operations and "extended" addressing.static ProgrammingMode
OPSACCEXTBYTEMODE
NMRA "Programming on the main" mode for stationary decoders, using only the byte-wise operations and "extended" addressing.static ProgrammingMode
OPSBITMODE
NMRA "Operations" or "Programming on the main" mode, using only the bit-wise operationsstatic ProgrammingMode
OPSBYTEMODE
NMRA "Operations" or "Programming on the main" mode, using only the byte-wise operations.static ProgrammingMode
PAGEMODE
NMRA "Paged" modestatic ProgrammingMode
REGISTERMODE
NMRA "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 boolean
equals(java.lang.Object o)
java.lang.String
getStandardName()
Return the standard (not localized, human readable) name.int
hashCode()
java.lang.String
toString()
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:
toString
in 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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-