Package com.itextpdf.barcodes.qrcode
Class FormatInformation
- java.lang.Object
-
- com.itextpdf.barcodes.qrcode.FormatInformation
-
final class FormatInformation extends java.lang.ObjectEncapsulates a QR Code's format information, including the data mask used and error correction level.- See Also:
ErrorCorrectionLevel
-
-
Field Summary
Fields Modifier and Type Field Description private static int[]BITS_SET_IN_HALF_BYTEOffset i holds the number of 1 bits in the binary representation of iprivate bytedataMaskprivate ErrorCorrectionLevelerrorCorrectionLevelprivate static int[][]FORMAT_INFO_DECODE_LOOKUPSee ISO 18004:2006, Annex C, Table C.1private static intFORMAT_INFO_MASK_QR
-
Constructor Summary
Constructors Modifier Constructor Description privateFormatInformation(int formatInfo)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static FormatInformationdecodeFormatInformation(int maskedFormatInfo1, int maskedFormatInfo2)private static FormatInformationdoDecodeFormatInformation(int maskedFormatInfo1, int maskedFormatInfo2)booleanequals(java.lang.Object o)Compares the Format Information of this and o(package private) bytegetDataMask()(package private) ErrorCorrectionLevelgetErrorCorrectionLevel()inthashCode()(package private) static intnumBitsDiffering(int a, int b)
-
-
-
Field Detail
-
FORMAT_INFO_MASK_QR
private static final int FORMAT_INFO_MASK_QR
- See Also:
- Constant Field Values
-
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
-
errorCorrectionLevel
private final ErrorCorrectionLevel errorCorrectionLevel
-
dataMask
private final byte dataMask
-
-
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 appliedmaskedFormatInfo2- second copy of same info; both are checked at the same time to establish best match- Returns:
- information about the format it specifies, or
nullif doesn't seem to match any known pattern
-
doDecodeFormatInformation
private static FormatInformation doDecodeFormatInformation(int maskedFormatInfo1, int maskedFormatInfo2)
-
getErrorCorrectionLevel
ErrorCorrectionLevel getErrorCorrectionLevel()
-
getDataMask
byte getDataMask()
- Returns:
- The datamask in byte-format
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hashcode of the QR-code format information
-
equals
public boolean equals(java.lang.Object o)
Compares the Format Information of this and o- Overrides:
equalsin classjava.lang.Object- Parameters:
o- object to compare to- Returns:
- True if o is a FormatInformationObject and the error-correction level and the datamask are equal, false otherwise
-
-