Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.ebay.redlasersdk
Class BarcodeResult

    java.lang.Object
      com.ebay.redlasersdk.BarcodeResult

All Implemented Interfaces:
  android.os.Parcelable, java.io.Serializable

    public class BarcodeResult

extends java.lang.Object
implements android.os.Parcelable, java.io.Serializable

Results from the SDK are delivered as members of this class. The SDK delivers a Collection of barcodes recognized during a scanning session, both to the status update method (which is called several times per second) and to the calling activity when scanning completes.

See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from interface android.os.Parcelable
`android.os.Parcelable.ClassLoaderCreator<T>, android.os.Parcelable.Creator<T>`

Field Summary
`java.util.UUID` | `associatedBarcode` Refers to the uniqueID field of a barcode that is associated with this barcode.
`java.util.ArrayList<android.graphics.PointF>` | `barcodeLocation` Barcode location in the coordinate system of the preview view.
`java.lang.String` | `barcodeString` Text of the barcode.
`int` | `barcodeType` The type of barcode found.
`static android.os.Parcelable.Creator<BarcodeResult>` | `CREATOR` Part of the Parcelable interface.
`java.lang.String` | `extendedBarcodeString` Extended barcode string.
`java.util.Date` | `firstScanTime` Timestamp of the initial recognition of this barcode.
`boolean` | `isPartialBarcode` TRUE if this is an incomplete barcode result.
`java.util.Date` | `mostRecentScanTime` Timestamp of the most recent time this barcode was recognized.
`java.util.UUID` | `uniqueID` A unique ID for this object instance; used by associatedBarcode

Fields inherited from interface android.os.Parcelable
`CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE`

Constructor Summary
`` | `BarcodeResult()` Default constructor.
`` | `BarcodeResult(BarcodeResult copyFrom)` Copy Constructor.
`protected` | `BarcodeResult(android.os.Parcel in)` Parcel constructor.

Method Summary
`int` | `describeContents()` Part of the Parcelable interface.
`boolean` | `equals(java.lang.Object o)` For BarcodeResults, instances that have the same barcodeSting and barcodeType are considered equal.
`BarcodeResult` | `getAssociatedBarcode(java.util.AbstractCollection<BarcodeResult> resultSet)` Returns the associated barcode counterpart to a barcode result.
`java.lang.String` | `getBarcodeType()` Returns the barcode type of this barcode, as a human-readable string.
`int` | `hashCode()` BarcodeResult overrides equals, so it must override hashCode.
`void` | `writeToParcel(android.os.Parcel out, int flags)` Writes all barcode fields to a Parcel object.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### barcodeType

    public int barcodeType

  The type of barcode found. Will be one of the types listed in `BarcodeTypes`.

### barcodeString

    public java.lang.String barcodeString

  Text of the barcode. This is the character string read from the barcode, without additional processing. This means that Code 128 and QR Code barcodes may have AI and DI markers, and the optional checksum character in Code 39 barcodes will be returned if present. See the pdf documentation on specific barcode types for more information on specific symbologies.

### extendedBarcodeString

    public java.lang.String extendedBarcodeString

  Extended barcode string. Currently only used for UPC-E barcodes; this will contain the expanded EAN-13 equivalent string.

### firstScanTime

    public java.util.Date firstScanTime

  Timestamp of the initial recognition of this barcode.

### mostRecentScanTime

    public java.util.Date mostRecentScanTime

  Timestamp of the most recent time this barcode was recognized. While scanning, this value will keep updating with the current time as long as the SDK can see the barcode.

### uniqueID

    public java.util.UUID uniqueID

  A unique ID for this object instance; used by associatedBarcode

### associatedBarcode

    public java.util.UUID associatedBarcode

  Refers to the uniqueID field of a barcode that is associated with this barcode. See the pdf documentation on associated barcodes.

### barcodeLocation

    public java.util.ArrayList<android.graphics.PointF> barcodeLocation

  Barcode location in the coordinate system of the preview view. This is a list of points defining the corners of the barcode. The first point in the array is the top left corner of the barcode. The second point in the array is the top right corner of the barcode.

  The list is NOT guaranteed to contain 4 points, the polygon it defines is not guaranteed to wind clockwise, and is not guaranteed to be convex. It is guaranteed to be a simple polygon.

  If a barcode is recognized upside-down in the viewfinder, the first point in the array will be the bottom-right of the returned points. This is because that point is the top-left corner of the barcode in its natural orientation. Similarly, when using the front camera, the first point will be to the right of the second point when scanning a barcode right side up, and the points will wind counterclockwise, since the camera preview is mirrored along the Y axis when using the front camera.

### isPartialBarcode

    public boolean isPartialBarcode

  TRUE if this is an incomplete barcode result. Some barcodes may be recognized in parts by scanning the device across the length of the barcode; see the pdf documentation. The barcodeString field of a partial barcode will contain an initial substring of the final barcode string.

### CREATOR

    public static android.os.Parcelable.Creator<BarcodeResult> CREATOR

  Part of the Parcelable interface. BarcodeResults get returned to the calling Activity via a return Intent.

Constructor Detail

### BarcodeResult

    public BarcodeResult()

  Default constructor. Constructs an empty result.

### BarcodeResult

    protected BarcodeResult(android.os.Parcel in)

  Parcel constructor. BarcodeResults are delivered to the app in a return Intent, and they are Parceled as part of that process.

  Parameters:
    `in` - The Parcel to rebuild the BarcodeResult from.

### BarcodeResult

    public BarcodeResult(BarcodeResult copyFrom)

  Copy Constructor. Deep copies anything mutable. BarcodeResults have several mutable fields--mostRecentScanTime for example will continually update as long as the barcode is visible. Results that arrive in a particular status update have been copy constructed; the SDK won't change values of members of that particular instance later. The next call to the status method will deliver a new copy of the same result.

Method Detail

### getBarcodeType

    public java.lang.String getBarcodeType()

  Returns the barcode type of this barcode, as a human-readable string.

  Returns:
    Barcode type string, such as "EAN-13" or "QR Code".

### getAssociatedBarcode

    public BarcodeResult getAssociatedBarcode(java.util.AbstractCollection<BarcodeResult> resultSet)

  Returns the associated barcode counterpart to a barcode result. This method searches the given collection for a barcode with a matching unique identifier. See the pdf documentation for more information about associated barcodes.

  Parameters:
    `resultSet` - The collection that should contain the associated barcode.
  Returns:
    BarcodeResult object containing associated barcode data

### describeContents

    public int describeContents()

  Part of the Parcelable interface.

  Specified by:
    `describeContents` in interface `android.os.Parcelable`

### writeToParcel

    public void writeToParcel(android.os.Parcel out,
                              int flags)

  Writes all barcode fields to a Parcel object.

  Specified by:
    `writeToParcel` in interface `android.os.Parcelable`

### equals

    public boolean equals(java.lang.Object o)

  For BarcodeResults, instances that have the same barcodeSting and barcodeType are considered equal. This is done to make inserting barcodeResults into sets work correctly.

  Overrides:
    `equals` in class `java.lang.Object`

### hashCode

    public int hashCode()

  BarcodeResult overrides equals, so it must override hashCode. BarcodeResults hash to the same value if and only if their barcodeType and barcodeString fields match. Other fields are not part of the hash.

  Overrides:
    `hashCode` in class `java.lang.Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012 eBay Inc. All Rights Reserved.