Package com.cognex.cmbsdk.readerdevice
Class ReadResults
java.lang.Object
com.cognex.cmbsdk.readerdevice.ReadResults
- All Implemented Interfaces:
android.os.Parcelable,Iterable<ReadResult>
Represents a list of read results
You can obtain individual subresults of type
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.-
Nested Class Summary
-
Field Summary
FieldsFields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintgetCount()Returns the number of resultsgetResultAt(int index) Returns aReadResultat the specified positionHelper method to retrieve multicode subresults.getXml()Returns the raw XML recieved from the readeriterator()static ReadResultsparse(ComplexResult result, ReaderDevice.ResultParser parser, ReadStringEncoding readStringEncoding, DataManDeviceClass deviceClass) voidwriteToParcel(android.os.Parcel parcel, int flags) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
CREATOR
-
-
Constructor Details
-
ReadResults
public ReadResults()
-
-
Method Details
-
describeContents
public int describeContents()- Specified by:
describeContentsin interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel parcel, int flags) - Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-
iterator
- Specified by:
iteratorin interfaceIterable<ReadResult>
-
getResultAt
Returns aReadResultat the specified position- Parameters:
index- index ofReadResultto retrieve- Returns:
ReadResultat 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
Returns the raw XML recieved from the reader- Returns:
- the raw XML string or null, if XML parsing has failed
-
getSubResults
Helper method to retrieve multicode subresults.- Returns:
- a list of
ReadResultor 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.XmlPullParserExceptionIOException
-