Class FormatInformation


  • final class FormatInformation
    extends java.lang.Object

    Encapsulates a QR Code's format information, including the data mask used and error correction level.

    Since:
    5.0.2
    See Also:
    ErrorCorrectionLevel
    • Field Detail

      • FORMAT_INFO_DECODE_LOOKUP

        private static final int[][] FORMAT_INFO_DECODE_LOOKUP
        See ISO 18004:2006, Annex C, Table C.1
      • BITS_SET_IN_HALF_BYTE

        private static final int[] BITS_SET_IN_HALF_BYTE
        Offset i holds the number of 1 bits in the binary representation of i
      • dataMask

        private final byte dataMask
    • Constructor Detail

      • FormatInformation

        private FormatInformation​(int formatInfo)
    • Method Detail

      • numBitsDiffering

        static int numBitsDiffering​(int a,
                                    int b)
      • decodeFormatInformation

        static FormatInformation decodeFormatInformation​(int maskedFormatInfo1,
                                                         int maskedFormatInfo2)
        Parameters:
        maskedFormatInfo1 - format info indicator, with mask still applied
        maskedFormatInfo2 - second copy of same info; both are checked at the same time to establish best match
        Returns:
        information about the format it specifies, or null if doesn't seem to match any known pattern
      • doDecodeFormatInformation

        private static FormatInformation doDecodeFormatInformation​(int maskedFormatInfo1,
                                                                   int maskedFormatInfo2)
      • getDataMask

        byte getDataMask()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object