public enum Mode extends Enum<Mode>
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.
| Enum Constant and Description |
|---|
ALPHANUMERICA l p h a n u m e r i c |
BYTEB y t e |
ECIE c i |
FNC1_FIRST_POSITIONF n c1 f i r s t p o s i t i o n |
FNC1_SECOND_POSITIONF n c1 s e c o n d p o s i t i o n |
HANZISee GBT 18284-2000; "Hanzi" is a transliteration of this mode name. |
KANJIK a n j i |
NUMERICN u m e r i c |
STRUCTURED_APPENDS t r u c t u r e d a p p e n d |
TERMINATORT e r m i n a t o r |
| Modifier and Type | Method and Description |
|---|---|
static Mode | forBits(int bits) |
int | getBits() |
int | getCharacterCountBits(Version version) |
static Mode | valueOf(String name)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. |
public static final Mode ALPHANUMERIC
public static final Mode BYTE
public static final Mode ECI
public static final Mode FNC1_FIRST_POSITION
public static final Mode FNC1_SECOND_POSITION
public static final Mode HANZI
public static final Mode KANJI
public static final Mode NUMERIC
public static final Mode STRUCTURED_APPEND
public static final Mode TERMINATOR
public static Mode forBits(int bits)
bits - four bits encoding a QR Code data modeIllegalArgumentException - if bits do not correspond to a known modepublic int getBits()
public int getCharacterCountBits(Version version)
version - version in questionVersion, to encode the
count of characters that will follow encoded in this Modepublic static Mode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static Mode[] values()
for (Mode c : Mode.values()) System.out.println(c);