Class UPCEReader
java.lang.Object
com.google.zxing.oned.OneDReader
com.google.zxing.oned.UPCEANReader
com.google.zxing.oned.UPCEReader
- All Implemented Interfaces:
Reader
Implements decoding of the UPC-E format.
This is a great reference for UPC-E information.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int[]private static final int[]The pattern that marks the middle, and end, of a UPC-E pattern.(package private) static final int[][]SeeUPCEANReader.L_AND_G_PATTERNS; these values similarly represent patterns of even-odd parity encodings of digits that imply both the number system (0 or 1) used, and the check digit.Fields inherited from class UPCEANReader
END_PATTERN, L_AND_G_PATTERNS, L_PATTERNS, MIDDLE_PATTERN, START_END_PATTERN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic StringconvertUPCEtoUPCA(String upce) Expands a UPC-E value back into its full, equivalent UPC-A code value.protected int[]protected intdecodeMiddle(BitArray row, int[] startRange, StringBuilder result) Subclasses override this to decode the portion of a barcode between the start and end guard patterns.private static voiddetermineNumSysAndCheckDigit(StringBuilder resultString, int lgPatternFound) (package private) BarcodeFormatGet the format of this decoder.Methods inherited from class UPCEANReader
checkStandardUPCEANChecksum, decodeDigit, decodeRow, decodeRow, findGuardPattern, findStartGuardPattern, getStandardUPCEANChecksumMethods inherited from class OneDReader
decode, decode, patternMatchVariance, recordPattern, recordPatternInReverse, reset
-
Field Details
-
MIDDLE_END_PATTERN
private static final int[] MIDDLE_END_PATTERNThe pattern that marks the middle, and end, of a UPC-E pattern. There is no "second half" to a UPC-E barcode. -
NUMSYS_AND_CHECK_DIGIT_PATTERNS
static final int[][] NUMSYS_AND_CHECK_DIGIT_PATTERNSSeeUPCEANReader.L_AND_G_PATTERNS; these values similarly represent patterns of even-odd parity encodings of digits that imply both the number system (0 or 1) used, and the check digit. -
decodeMiddleCounters
private final int[] decodeMiddleCounters
-
-
Constructor Details
-
UPCEReader
public UPCEReader()
-
-
Method Details
-
decodeMiddle
protected int decodeMiddle(BitArray row, int[] startRange, StringBuilder result) 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 patternresult-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
-
decodeEnd
- Overrides:
decodeEndin classUPCEANReader- Throws:
NotFoundException
-
checkChecksum
- Overrides:
checkChecksumin classUPCEANReader- Parameters:
s- string of digits to check- Returns:
UPCEANReader.checkStandardUPCEANChecksum(CharSequence)- Throws:
FormatException- if the string does not contain only digits
-
determineNumSysAndCheckDigit
private static void determineNumSysAndCheckDigit(StringBuilder resultString, int lgPatternFound) throws NotFoundException - Throws:
NotFoundException
-
getBarcodeFormat
BarcodeFormat getBarcodeFormat()Description copied from class:UPCEANReaderGet the format of this decoder.- Specified by:
getBarcodeFormatin classUPCEANReader- Returns:
- The 1D format.
-
convertUPCEtoUPCA
-