Package com.google.zxing.oned
Class UPCEReader
- java.lang.Object
-
- com.google.zxing.oned.OneDReader
-
- com.google.zxing.oned.UPCEANReader
-
- com.google.zxing.oned.UPCEReader
-
- All Implemented Interfaces:
Reader
public final class UPCEReader extends UPCEANReader
Implements decoding of the UPC-E format.
This is a great reference for UPC-E information.
-
-
Field Summary
-
Fields inherited from class com.google.zxing.oned.OneDReader
INTEGER_MATH_SHIFT, PATTERN_MATCH_RESULT_SCALE_FACTOR
-
-
Constructor Summary
Constructors Constructor Description UPCEReader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancheckChecksum(java.lang.String s)static java.lang.StringconvertUPCEtoUPCA(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 intdecodeMiddle(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.-
Methods inherited from class com.google.zxing.oned.UPCEANReader
decodeRow, decodeRow
-
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 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
protected int[] decodeEnd(BitArray row, int endStart) throws NotFoundException
- Throws:
NotFoundException
-
checkChecksum
protected boolean checkChecksum(java.lang.String s) throws FormatException- Throws:
FormatException
-
convertUPCEtoUPCA
public static java.lang.String convertUPCEtoUPCA(java.lang.String upce)
Expands a UPC-E value back into its full, equivalent UPC-A code value.- Parameters:
upce- UPC-E code as string of digits- Returns:
- equivalent UPC-A code as string of digits
-
-