Package com.google.zxing.qrcode.decoder
Enum Mode
- All Implemented Interfaces:
Serializable
,Comparable<Mode>
,java.lang.constant.Constable
See ISO 18004:2006, 6.4.1, Tables 2 and 3. This enum encapsulates the various modes in which data can be encoded to bits in the QR code standard.
- Author:
- Sean Owen
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionSee GBT 18284-2000; "Hanzi" is a transliteration of this mode name. -
Method Summary
Modifier and TypeMethodDescriptionstatic Mode
forBits
(int bits) int
getBits()
int
getCharacterCountBits
(Version version) static Mode
Returns the enum constant of this type with the specified name.static Mode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
TERMINATOR
-
NUMERIC
-
ALPHANUMERIC
-
STRUCTURED_APPEND
-
BYTE
-
ECI
-
KANJI
-
FNC1_FIRST_POSITION
-
FNC1_SECOND_POSITION
-
HANZI
See GBT 18284-2000; "Hanzi" is a transliteration of this mode name.
-
-
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
-
forBits
- 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
- Parameters:
version
- version in question- Returns:
- number of bits used, in this QR Code symbol
Version
, to encode the count of characters that will follow encoded in this Mode
-
getBits
public int getBits()
-