Package com.microblink.blinkid.entities.recognizers

# Class RecognizerBundle

java.lang.Object
com.microblink.blinkid.intent.BaseIntentTransferable<RecognizerBundle>
com.microblink.blinkid.entities.recognizers.RecognizerBundle

All Implemented Interfaces:
  `android.os.Parcelable`, `com.microblink.blinkid.intent.MBIntentTransferable`

public class RecognizerBundle extends com.microblink.blinkid.intent.BaseIntentTransferable<RecognizerBundle>
Represents a bundle of `Recognizer` objects that can travel via `Intent`

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `RecognizerBundle.FrameQualityEstimationMode`
  `static enum`
  `RecognizerBundle.RecognitionDebugMode`

  ## Nested classes/interfaces inherited from interface android.os.Parcelable

  `android.os.Parcelable.ClassLoaderCreator<T extends Object>, android.os.Parcelable.Creator<T extends Object>`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final android.os.Parcelable.Creator<RecognizerBundle>`
  `CREATOR`
  `static final int`
  `TIMEOUT_INFINITY`
  Constant used as argument for `setNumMsBeforeTimeout(int)` method when timeout should be set to infinity.

  ### Fields inherited from interface android.os.Parcelable

  `CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RecognizerBundle(Recognizer... recognizers)`
  `RecognizerBundle(List<Recognizer> recognizerList)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `consumeContentFromLoadedObject(RecognizerBundle loadedBundle)`
  Consumes content from object loaded from intent.
  `static final RecognizerBundle`
  `createFromIntent(android.content.Intent intent)`
  Creates object of this class from `Intent`.
  `boolean`
  `equals(Object o)`
  `protected android.os.Parcelable.Creator<RecognizerBundle>`
  `getConcreteCreator()`
  Returns parcelable creator for concrete intent transferable type.
  `RecognizerBundle.FrameQualityEstimationMode`
  `getFrameQualityEstimationMode()`
  `int`
  `getNumMsBeforeTimeout()`
  Returns the duration in milliseconds that needs to pass since scanning has begun in order to define timeout.
  `RecognizerBundle.RecognitionDebugMode`
  `getRecognitionDebugMode()`
  Returns the current recognition mode.
  `Recognizer<Recognizer.Result>[]`
  `getRecognizers()`
  Returns the array of recognizers associated with this bundle.
  `protected String`
  `getUniqueIdIntentExtraKey()`
  Returns intent extra that will be used for transferring object unique ID.
  `protected void`
  `readFromParcel(android.os.Parcel in)`
  `void`
  `saveToIntent(android.content.Intent intent)`
  Saves this `RecognizerBundle` to `Intent` so it can be passed to another `Activity`.
  `void`
  `setAllowMultipleScanResultsOnSingleImage(boolean multiScan)`
  Sets whether or not outputting of multiple scan results from same image is allowed.
  `void`
  `setFrameQualityEstimationMode(RecognizerBundle.FrameQualityEstimationMode mode)`
  Sets the mode of the frame quality estimation.
  `void`
  `setNumMsBeforeTimeout(int numMsBeforeTimeout)`
  Set the duration in milliseconds that needs to pass since scanning has begun in order to define timeout.
  `void`
  `setRecognitionDebugMode(RecognizerBundle.RecognitionDebugMode recognitionMode)`
  This method is for debugging and testing purposes only.
  `boolean`
  `shouldAllowMultipleScanResultsOnSingleImage()`
  Returns true if multiple scan results can be obtained from single image.
  `void`
  `writeToParcel(android.os.Parcel dest, int flags)`

  ### Methods inherited from class com.microblink.blinkid.intent.BaseIntentTransferable

  `clearSavedState, describeContents, existsInIntent, loadFromIntent, saveState`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### TIMEOUT_INFINITY

    public static final int TIMEOUT_INFINITY
    Constant used as argument for `setNumMsBeforeTimeout(int)` method when timeout should be set to infinity. Effectively, this means that recognition timeout will be disabled.
    See Also:
      - `setNumMsBeforeTimeout(int)`
      - Constant Field Values

  - ### CREATOR

    @NonNull public static final android.os.Parcelable.Creator<RecognizerBundle> CREATOR

- ## Constructor Details

  - ### RecognizerBundle

    public RecognizerBundle(@NonNull Recognizer... recognizers)

  - ### RecognizerBundle

    public RecognizerBundle(@NonNull List<Recognizer> recognizerList)

- ## Method Details

  - ### createFromIntent

    @Nullable public static final RecognizerBundle createFromIntent(@NonNull android.content.Intent intent)
    Creates object of this class from `Intent`.
    Parameters:
      `intent` - intent in which object is stored.
    Returns:
      created object or `null` if it does not exist in the given intent.

  - ### getRecognizers

    @NonNull public Recognizer<Recognizer.Result>[] getRecognizers()
    Returns the array of recognizers associated with this bundle.
    Returns:
      the array of recognizers associated with this bundle.

  - ### getRecognitionDebugMode

    @NonNull public RecognizerBundle.RecognitionDebugMode getRecognitionDebugMode()
    Returns the current recognition mode.
    Returns:
      the current recognition mode.

  - ### setRecognitionDebugMode

    public void setRecognitionDebugMode(@NonNull RecognizerBundle.RecognitionDebugMode recognitionMode)
    This method is for debugging and testing purposes only. Please do not use it because calling it with wrong parameter might cause scanning loop to never terminate.
    Parameters:
      `recognitionMode` - Requested mode of recognition.

  - ### shouldAllowMultipleScanResultsOnSingleImage

    public boolean shouldAllowMultipleScanResultsOnSingleImage()
    Returns true if multiple scan results can be obtained from single image. See `setAllowMultipleScanResultsOnSingleImage(boolean)` for details.
    Returns:
      true if multiple scan results can be obtained from single image.

  - ### setAllowMultipleScanResultsOnSingleImage

    public void setAllowMultipleScanResultsOnSingleImage(boolean multiScan)
    Sets whether or not outputting of multiple scan results from same image is allowed. If that is true, it is possible to return multiple recognition results from same image. If this option is false, at most single recognizer inside this bundle will be updated with latest results. If this option is true, it is possible that multiple recognizers inside this bundle will be updated with latest results. The upside of setting that option to false is the speed - if you have lots of recognizers in this bundle, as soon as the first recognizer succeeds in scanning, recognition chain will be terminated and other recognizers will not get a chance to analyze the image. The downside is that you are then unable to obtain multiple results from single image.

  - ### setNumMsBeforeTimeout

    public void setNumMsBeforeTimeout(int numMsBeforeTimeout)
    Set the duration in milliseconds that needs to pass since scanning has begun in order to define timeout. Please be aware that time counting does not start from the moment when scanning starts. Instead it starts from the moment when at least one `Recognizer.Result` inside recognizers in this bundle changes its state `Recognizer.Result.getResultState()` to either `Recognizer.Result.State.Uncertain` or `Recognizer.Result.State.Valid`.

    The reason for this is the better user experience in cases when for example timeout is set to 10 seconds and user starts scanning and leaves device lying on table for 9 seconds and then points the device towards the object it wants to scan: in such case it is better to let that user scan the object it wants instead of completing scan with empty scan result as soon as 10 seconds timeout ticks out.
    Parameters:
      `numMsBeforeTimeout` - duration in milliseconds

  - ### getNumMsBeforeTimeout

    public int getNumMsBeforeTimeout()
    Returns the duration in milliseconds that needs to pass since scanning has begun in order to define timeout.
    Returns:
      the duration in milliseconds that needs to pass since scanning has begun in order to define timeout.
    See Also:
      - `setNumMsBeforeTimeout(int)`

  - ### setFrameQualityEstimationMode

    public void setFrameQualityEstimationMode(@NonNull RecognizerBundle.FrameQualityEstimationMode mode)
    Sets the mode of the frame quality estimation. If automatic, it will be used if at least one enabled recognizer requires it or if device is fast enough to perform it always (default). If always on or always off, it will not depend on active recognizers nor device. Frame quality estimation helps choosing the best possible frame from camera stream for processing.
    Parameters:
      `mode` - Desired mode of frame quality estimation.

  - ### getFrameQualityEstimationMode

    @NonNull public RecognizerBundle.FrameQualityEstimationMode getFrameQualityEstimationMode()

  - ### getUniqueIdIntentExtraKey

    @NonNull protected String getUniqueIdIntentExtraKey()
    Description copied from class: `com.microblink.blinkid.intent.BaseIntentTransferable`
    Returns intent extra that will be used for transferring object unique ID. Different concrete classes cannot use the same intent extra key for this purpose because that will make sending objects from different concrete classes over the same intent impossible.
    Specified by:
      `getUniqueIdIntentExtraKey` in class `com.microblink.blinkid.intent.BaseIntentTransferable<RecognizerBundle>`
    Returns:
      intent extra that will be used for transferring object unique ID.

  - ### getConcreteCreator

    @NonNull protected android.os.Parcelable.Creator<RecognizerBundle> getConcreteCreator()
    Description copied from class: `com.microblink.blinkid.intent.BaseIntentTransferable`
    Returns parcelable creator for concrete intent transferable type.
    Specified by:
      `getConcreteCreator` in class `com.microblink.blinkid.intent.BaseIntentTransferable<RecognizerBundle>`
    Returns:
      parcelable creator for concrete intent transferable type.

  - ### consumeContentFromLoadedObject

    protected void consumeContentFromLoadedObject(@NonNull RecognizerBundle loadedBundle)
    Description copied from class: `com.microblink.blinkid.intent.BaseIntentTransferable`
    Consumes content from object loaded from intent.
    Specified by:
      `consumeContentFromLoadedObject` in class `com.microblink.blinkid.intent.BaseIntentTransferable<RecognizerBundle>`

  - ### saveToIntent

    public void saveToIntent(@NonNull android.content.Intent intent)
    Saves this `RecognizerBundle` to `Intent` so it can be passed to another `Activity`.
    Specified by:
      `saveToIntent` in interface `com.microblink.blinkid.intent.MBIntentTransferable`
    Overrides:
      `saveToIntent` in class `com.microblink.blinkid.intent.BaseIntentTransferable<RecognizerBundle>`
    Parameters:
      `intent` - Intent to which `RecognizerBundle` should be saved.

  - ### equals

    public boolean equals(@Nullable Object o)
    Overrides:
      `equals` in class `Object`

  - ### readFromParcel

    protected void readFromParcel(@NonNull android.os.Parcel in)
    Overrides:
      `readFromParcel` in class `com.microblink.blinkid.intent.BaseIntentTransferable<RecognizerBundle>`

  - ### writeToParcel

    public void writeToParcel(@NonNull android.os.Parcel dest, int flags)
    Specified by:
      `writeToParcel` in interface `android.os.Parcelable`
    Overrides:
      `writeToParcel` in class `com.microblink.blinkid.intent.BaseIntentTransferable<RecognizerBundle>`