- All Implemented Interfaces:
Serializable, Comparable<Mode>, java.lang.constant.Constable
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E>Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAlphanumeric mode for encoding letters and digits.Byte mode for arbitrary data.ECI mode for switching character sets.FNC1 first position mode.FNC1 second position mode.See GBT 18284-2000; "Hanzi" is a transliteration of this mode name.Kanji mode for encoding Shift JIS characters.Numeric mode for encoding digits.Structured append mode for combining QR symbols.Terminator mode for ending a QR symbol.Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe four bits naming the mode in the data.private final int[]Count-field size for each of the three version groups.Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMode(int[] characterCountBitsForVersions, int bits) Creates a mode with its character-count bit tables.Method Summary
Modifier and TypeMethodDescriptionstatic ModeforBits(int bits) Look up the data mode a four-bit type field encodes.intgetBits()Return the four-bit type field value for this mode.intgetCharacterCountBits(Version version) Return how many bits the character count field occupies for a version.static ModeReturns the enum constant of this class with the specified name.static Mode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
Enum Constant Details
TERMINATOR
Terminator mode for ending a QR symbol.NUMERIC
Numeric mode for encoding digits.ALPHANUMERIC
Alphanumeric mode for encoding letters and digits.STRUCTURED_APPEND
Structured append mode for combining QR symbols.BYTE
Byte mode for arbitrary data.ECI
ECI mode for switching character sets.KANJI
Kanji mode for encoding Shift JIS characters.FNC1_FIRST_POSITION
FNC1 first position mode.FNC1_SECOND_POSITION
FNC1 second position mode.HANZI
See GBT 18284-2000; "Hanzi" is a transliteration of this mode name.
Field Details
characterCountBitsForVersions
private final int[] characterCountBitsForVersionsCount-field size for each of the three version groups.bits
private final int bitsThe four bits naming the mode in the data.
Constructor Details
Mode
private Mode(int[] characterCountBitsForVersions, int bits) Creates a mode with its character-count bit tables.- Parameters:
characterCountBitsForVersions- per-version bit countsbits- the mode indicator bits
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
forBits
Look up the data mode a four-bit type field encodes.- Parameters:
bits- four bits encoding a QR Code data mode- Returns:
- Mode encoded by these bits
- Throws:
IllegalArgumentException- if bits do not correspond to a known mode
getCharacterCountBits
getBits
public int getBits()Return the four-bit type field value for this mode.- Returns:
- the four-bit type field value that encodes this mode