Package com.google.zxing.oned
Class EAN13Reader
- java.lang.Object
-
- com.google.zxing.oned.OneDReader
-
- com.google.zxing.oned.UPCEANReader
-
- com.google.zxing.oned.EAN13Reader
-
- All Implemented Interfaces:
Reader
public final class EAN13Reader extends UPCEANReader
Implements decoding of the EAN-13 format.
-
-
Field Summary
Fields Modifier and Type Field Description private int[]decodeMiddleCounters(package private) static int[]FIRST_DIGIT_ENCODINGS-
Fields inherited from class com.google.zxing.oned.UPCEANReader
END_PATTERN, L_AND_G_PATTERNS, L_PATTERNS, MIDDLE_PATTERN, START_END_PATTERN
-
-
Constructor Summary
Constructors Constructor Description EAN13Reader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intdecodeMiddle(BitArray row, int[] startRange, java.lang.StringBuilder resultString)Subclasses override this to decode the portion of a barcode between the start and end guard patterns.private static voiddetermineFirstDigit(java.lang.StringBuilder resultString, int lgPatternFound)Based on pattern of odd-even ('L' and 'G') patterns used to encoded the explicitly-encoded digits in a barcode, determines the implicitly encoded first digit and adds it to the result string.(package private) BarcodeFormatgetBarcodeFormat()Get the format of this decoder.-
Methods inherited from class com.google.zxing.oned.UPCEANReader
checkChecksum, checkStandardUPCEANChecksum, decodeDigit, decodeEnd, decodeRow, decodeRow, findGuardPattern, findStartGuardPattern, getStandardUPCEANChecksum
-
Methods inherited from class com.google.zxing.oned.OneDReader
decode, decode, patternMatchVariance, recordPattern, recordPatternInReverse, reset
-
-
-
-
Method Detail
-
decodeMiddle
protected int decodeMiddle(BitArray row, int[] startRange, java.lang.StringBuilder resultString) throws NotFoundException
Description copied from class:UPCEANReaderSubclasses override this to decode the portion of a barcode between the start and end guard patterns.- Specified by:
decodeMiddlein classUPCEANReader- Parameters:
row- row of black/white values to searchstartRange- start/end offset of start guard patternresultString-StringBuilderto append decoded chars to- Returns:
- horizontal offset of first pixel after the "middle" that was decoded
- Throws:
NotFoundException- if decoding could not complete successfully
-
getBarcodeFormat
BarcodeFormat getBarcodeFormat()
Description copied from class:UPCEANReaderGet the format of this decoder.- Specified by:
getBarcodeFormatin classUPCEANReader- Returns:
- The 1D format.
-
determineFirstDigit
private static void determineFirstDigit(java.lang.StringBuilder resultString, int lgPatternFound) throws NotFoundExceptionBased on pattern of odd-even ('L' and 'G') patterns used to encoded the explicitly-encoded digits in a barcode, determines the implicitly encoded first digit and adds it to the result string.- Parameters:
resultString- string to insert decoded first digit intolgPatternFound- int whose bits indicates the pattern of odd/even L/G patterns used to encode digits- Throws:
NotFoundException- if first digit cannot be determined
-
-