com.google.zxing.oned
Class UPCEReader

java.lang.Object
  extended by com.google.zxing.oned.OneDReader
      extended by com.google.zxing.oned.UPCEANReader
          extended by 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.

Author:
Sean Owen

Field Summary
 
Fields inherited from class com.google.zxing.oned.OneDReader
INTEGER_MATH_SHIFT, PATTERN_MATCH_RESULT_SCALE_FACTOR
 
Constructor Summary
UPCEReader()
           
 
Method Summary
protected  boolean checkChecksum(String s)
           
static String convertUPCEtoUPCA(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, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UPCEReader

public UPCEReader()
Method Detail

decodeMiddle

protected int decodeMiddle(BitArray row,
                           int[] startRange,
                           StringBuilder result)
                    throws NotFoundException
Description copied from class: UPCEANReader
Subclasses override this to decode the portion of a barcode between the start and end guard patterns.

Specified by:
decodeMiddle in class UPCEANReader
Parameters:
row - row of black/white values to search
startRange - start/end offset of start guard pattern
result - StringBuilder to 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(String s)
                         throws FormatException,
                                ChecksumException
Returns:
UPCEANReader.checkStandardUPCEANChecksum(CharSequence)
Throws:
FormatException
ChecksumException

convertUPCEtoUPCA

public static String convertUPCEtoUPCA(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


Copyright © 2007-2012. All Rights Reserved.