public final class UPCEReader extends UPCEANReader
Implements decoding of the UPC-E format.
This is a great reference for UPC-E information.
Modifier and Type | Field and Description |
---|---|
private int[] |
decodeMiddleCounters |
private static int[] |
MIDDLE_END_PATTERN
The pattern that marks the middle, and end, of a UPC-E pattern.
|
(package private) static int[][] |
NUMSYS_AND_CHECK_DIGIT_PATTERNS
See
UPCEANReader.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. |
END_PATTERN, L_AND_G_PATTERNS, L_PATTERNS, MIDDLE_PATTERN, START_END_PATTERN
Constructor and Description |
---|
UPCEReader() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkChecksum(java.lang.String s) |
static java.lang.String |
convertUPCEtoUPCA(java.lang.String upce)
Expands a UPC-E value back into its full, equivalent UPC-A code value.
|
protected int[] |
decodeEnd(BitArray row,
int endStart) |
protected int |
decodeMiddle(BitArray row,
int[] startRange,
java.lang.StringBuilder result)
Subclasses override this to decode the portion of a barcode between the start
and end guard patterns.
|
private static void |
determineNumSysAndCheckDigit(java.lang.StringBuilder resultString,
int lgPatternFound) |
(package private) BarcodeFormat |
getBarcodeFormat()
Get the format of this decoder.
|
checkStandardUPCEANChecksum, decodeDigit, decodeRow, decodeRow, findGuardPattern, findStartGuardPattern, getStandardUPCEANChecksum
decode, decode, patternMatchVariance, recordPattern, recordPatternInReverse, reset
private static final int[] MIDDLE_END_PATTERN
static final int[][] NUMSYS_AND_CHECK_DIGIT_PATTERNS
UPCEANReader.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.private final int[] decodeMiddleCounters
protected int decodeMiddle(BitArray row, int[] startRange, java.lang.StringBuilder result) throws NotFoundException
UPCEANReader
decodeMiddle
in class UPCEANReader
row
- row of black/white values to searchstartRange
- start/end offset of start guard patternresult
- StringBuilder
to append decoded chars toNotFoundException
- if decoding could not complete successfullyprotected int[] decodeEnd(BitArray row, int endStart) throws NotFoundException
decodeEnd
in class UPCEANReader
NotFoundException
protected boolean checkChecksum(java.lang.String s) throws FormatException
checkChecksum
in class UPCEANReader
s
- string of digits to checkUPCEANReader.checkStandardUPCEANChecksum(CharSequence)
FormatException
- if the string does not contain only digitsprivate static void determineNumSysAndCheckDigit(java.lang.StringBuilder resultString, int lgPatternFound) throws NotFoundException
NotFoundException
BarcodeFormat getBarcodeFormat()
UPCEANReader
getBarcodeFormat
in class UPCEANReader
public static java.lang.String convertUPCEtoUPCA(java.lang.String upce)
upce
- UPC-E code as string of digits