Package 

Interface MultiPageImageCaptureScenario.PageStorage


  • 
    public interface MultiPageImageCaptureScenario.PageStorage
    
                        

    API for implementing a custom image storage.

    Most common scenarios will work with the default page storage. PageStorage interface is intended for advanced users and specific scenarios.

    PageStorage can be represented as a collection of pages, where each page is assigned with a unique identifier (GUID) and is itself a key-value collection with string keys and arbitrary data values (byte[]/NSData). Key-value relationship is to be maintained on the client side. An example of a key is an image or a thumbnail.

    The default implementation of the PageStorage is file-based. By default it has a root folder located in application's internal storage. Each page is stored in a subfolder of the root folder named with page's identifier. All page-related data, such as captured image and its properties, is stored in files inside the corresponding subfolder.

    Methods can be used for creation and managing pages of the image storage.

    This logic is also used in the custom image storage implementation with the PageStorage interface and its methods.

    To use the implemented custom storage instead of the default one, use the corresponding Builder.

    This interface and its methods are to be implemented on the client side.

    • Method Summary

      Modifier and Type Method Description
      abstract String create() Creates an empty page with a string identifier and adds it to the storage.
      abstract Unit delete(String pageId) Removes the page with specified identifier.
      abstract List<String> getPages() Returns all the pages identifiers in the storage.
      abstract Unit store(String pageId, String key, ByteArray data) Adds, removes or edits data, associated with the key of the page with the specified identifier.
      abstract ByteArray load(String pageId, String key) Returns the data of the certain page, associated with the specified key.
      abstract Unit clear() Removes all the pages from the storage.
      • Methods inherited from class com.abbyy.mobile.uicomponents.scenario.MultiPageImageCaptureScenario.PageStorage

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • create

        @WorkerThread() abstract String create()

        Creates an empty page with a string identifier and adds it to the storage.

      • delete

        @WorkerThread() abstract Unit delete(String pageId)

        Removes the page with specified identifier.

        Parameters:
        pageId - Identifier of the page to be removed.
      • getPages

        @WorkerThread() abstract List<String> getPages()

        Returns all the pages identifiers in the storage.

      • store

        @WorkerThread() abstract Unit store(String pageId, String key, ByteArray data)

        Adds, removes or edits data, associated with the key of the page with the specified identifier.

        Parameters:
        pageId - Identifier of the page with certain data.
        key - The key, associated with the data to be edited.
        data - Exact data to be added to the page by the key.
      • load

        @WorkerThread() abstract ByteArray load(String pageId, String key)

        Returns the data of the certain page, associated with the specified key.

        Parameters:
        pageId - Identifier of the page with certain data.
        key - The key, associated with the data to be edited.
      • clear

        @WorkerThread() abstract Unit clear()

        Removes all the pages from the storage.