Enum Mode

java.lang.Object
java.lang.Enum<Mode>
com.google.zxing.qrcode.decoder.Mode
All Implemented Interfaces:
Serializable, Comparable<Mode>, java.lang.constant.Constable

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.

Author:
Sean Owen
  • Enum Constant Details

  • Method Details

    • values

      public static Mode[] 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

      public static Mode valueOf​(String name)
      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 name
      NullPointerException - if the argument is null
    • forBits

      public static Mode forBits​(int bits)
      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

      public int getCharacterCountBits​(Version version)
      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()