com.google.zxing.oned
Class UPCAReader

java.lang.Object
  extended by com.google.zxing.oned.AbstractOneDReader
      extended by com.google.zxing.oned.AbstractUPCEANReader
          extended by com.google.zxing.oned.UPCAReader
All Implemented Interfaces:
OneDReader, UPCEANReader, Reader

public final class UPCAReader
extends AbstractUPCEANReader

Implements decoding of the UPC-A format.

Since:
BlackBerry API 6.0.0

Field Summary
 
Fields inherited from class com.google.zxing.oned.AbstractOneDReader
INTEGER_MATH_SHIFT, PATTERN_MATCH_RESULT_SCALE_FACTOR
 
Constructor Summary
UPCAReader()
           
 
Method Summary
 Result decode(BinaryBitmap image)
          Locates and decodes a barcode in some format within an image.
 Result decode(BinaryBitmap image, Hashtable hints)
          Locates and decodes a barcode in some format within an image.
protected  int decodeMiddle(BitArray row, int[] startRange, StringBuffer resultString)
          Subclasses override this to decode the portion of a barcode between the start and end guard patterns.
 Result decodeRow(int rowNumber, BitArray row, int[] startGuardRange)
          Like AbstractUPCEANReader.decodeRow(int, BitArray, java.util.Hashtable), but allows caller to inform method about where the UPC/EAN start pattern is found.
 Result decodeRow(int rowNumber, BitArray row, int[] startGuardRange, Hashtable hints)
          Like AbstractUPCEANReader.decodeRow(int, BitArray, java.util.Hashtable), but allows caller to inform method about where the UPC/EAN start pattern is found.
 Result decodeRow(int rowNumber, BitArray row, Hashtable hints)
          Attempts to decode a one-dimensional barcode format given a single row of an image.
 
Methods inherited from class com.google.zxing.oned.AbstractOneDReader
patternMatchVariance, recordPattern, recordPatternInReverse
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

UPCAReader

public UPCAReader()
Since:
BlackBerry API 6.0.0


Method Detail

decodeRow

public Result decodeRow(int rowNumber,
                        BitArray row,
                        int[] startGuardRange)
                 throws NotFoundException,
                        FormatException,
                        ChecksumException
Description copied from class: AbstractUPCEANReader

Like AbstractUPCEANReader.decodeRow(int, BitArray, java.util.Hashtable), but allows caller to inform method about where the UPC/EAN start pattern is found. This allows this to be computed once and reused across many implementations.

Specified by:
decodeRow in interface UPCEANReader
Overrides:
decodeRow in class AbstractUPCEANReader
Throws:
NotFoundException
FormatException
ChecksumException
Since:
BlackBerry API 6.0.0

decodeRow

public Result decodeRow(int rowNumber,
                        BitArray row,
                        int[] startGuardRange,
                        Hashtable hints)
                 throws NotFoundException,
                        FormatException,
                        ChecksumException
Description copied from class: AbstractUPCEANReader

Like AbstractUPCEANReader.decodeRow(int, BitArray, java.util.Hashtable), but allows caller to inform method about where the UPC/EAN start pattern is found. This allows this to be computed once and reused across many implementations.

Overrides:
decodeRow in class AbstractUPCEANReader
Throws:
NotFoundException
FormatException
ChecksumException
Since:
BlackBerry API 7.0.0

decodeRow

public Result decodeRow(int rowNumber,
                        BitArray row,
                        Hashtable hints)
                 throws NotFoundException,
                        FormatException,
                        ChecksumException
Description copied from class: AbstractOneDReader

Attempts to decode a one-dimensional barcode format given a single row of an image.

Specified by:
decodeRow in interface OneDReader
Overrides:
decodeRow in class AbstractUPCEANReader
Parameters:
rowNumber - row number from top of the row
row - the black/white pixel data of the row
hints - decode hints
Returns:
Result containing encoded string and start/end of barcode
Throws:
NotFoundException - if an error occurs or barcode cannot be found
FormatException
ChecksumException
Since:
BlackBerry API 6.0.0

decode

public Result decode(BinaryBitmap image)
              throws NotFoundException,
                     FormatException
Description copied from interface: Reader
Locates and decodes a barcode in some format within an image.

Specified by:
decode in interface Reader
Overrides:
decode in class AbstractOneDReader
Parameters:
image - image of barcode to decode
Returns:
String which the barcode encodes
Throws:
NotFoundException - if the barcode cannot be located or decoded for any reason
FormatException
Since:
BlackBerry API 6.0.0

decode

public Result decode(BinaryBitmap image,
                     Hashtable hints)
              throws NotFoundException,
                     FormatException
Description copied from interface: Reader
Locates and decodes a barcode in some format within an image. This method also accepts hints, each possibly associated to some data, which may help the implementation decode.

Specified by:
decode in interface Reader
Overrides:
decode in class AbstractOneDReader
Parameters:
image - image of barcode to decode
hints - passed as a Hashtable from DecodeHintType to arbitrary data. The meaning of the data depends upon the hint type. The implementation may or may not do anything with these hints.
Returns:
String which the barcode encodes
Throws:
NotFoundException - if the barcode cannot be located or decoded for any reason
FormatException
Since:
BlackBerry API 6.0.0

decodeMiddle

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

Specified by:
decodeMiddle in class AbstractUPCEANReader
Parameters:
row - row of black/white values to search
startRange - start/end offset of start guard pattern
resultString - StringBuffer 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
Since:
BlackBerry API 7.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal