Class ReadResults

java.lang.Object
com.cognex.cmbsdk.readerdevice.ReadResults
All Implemented Interfaces:
android.os.Parcelable, Iterable<ReadResult>

public class ReadResults extends Object implements android.os.Parcelable, Iterable<ReadResult>
Represents a list of read results

You can obtain individual subresults of type ReadResult using getSubResults method. At single code read the ReadResult object can be found at position 0. On multi code read, the ReadResult object at position 0 is a processed combination of all sub results. Positions 1..n contain the individual subresults.
  • Field Details

    • CREATOR

      public static final android.os.Parcelable.Creator<ReadResults> CREATOR
  • Constructor Details

    • ReadResults

      public ReadResults()
  • Method Details

    • describeContents

      public int describeContents()
      Specified by:
      describeContents in interface android.os.Parcelable
    • writeToParcel

      public void writeToParcel(android.os.Parcel parcel, int flags)
      Specified by:
      writeToParcel in interface android.os.Parcelable
    • iterator

      public Iterator<ReadResult> iterator()
      Specified by:
      iterator in interface Iterable<ReadResult>
    • getResultAt

      public ReadResult getResultAt(int index)
      Returns a ReadResult at the specified position
      Parameters:
      index - index of ReadResult to retrieve
      Returns:
      ReadResult at the specified index
      Throws:
      IndexOutOfBoundsException - if the index is out of range
    • getCount

      public int getCount()
      Returns the number of results
      Returns:
      the number of results
    • getXml

      public String getXml()
      Returns the raw XML recieved from the reader
      Returns:
      the raw XML string or null, if XML parsing has failed
    • getSubResults

      public List<ReadResult> getSubResults()
      Helper method to retrieve multicode subresults.
      Returns:
      a list of ReadResult or null if only a single code was read
    • parse

      public static ReadResults parse(ComplexResult result, ReaderDevice.ResultParser parser, ReadStringEncoding readStringEncoding, DataManDeviceClass deviceClass) throws org.xmlpull.v1.XmlPullParserException, IOException
      Throws:
      org.xmlpull.v1.XmlPullParserException
      IOException