Package io.scanbot.sdk.check.result
Class CheckRecognizerResultLruStorage
-
- All Implemented Interfaces:
-
io.scanbot.sdk.ui.result.ResultStorage
public final class CheckRecognizerResultLruStorage implements ResultStorage<CheckRecognizerResult>
Stores and provides access to the recognized result of the given type by ResultId This implementation uses LRU cache as a storage to keep the memory usage low even if many results will be added to the storage
-
-
Field Summary
Fields Modifier and Type Field Description public final static Integer
LRU_CACHE_SIZE
private final Class<CheckRecognizerResult>
acceptedType
-
Constructor Summary
Constructors Constructor Description CheckRecognizerResultLruStorage()
-
Method Summary
Modifier and Type Method Description Class<CheckRecognizerResult>
getAcceptedType()
Unit
putResult(String resultId, CheckRecognizerResult result)
Puts the given result to the storage on the given id CheckRecognizerResult
getResult(String resultId)
Returns the result from the storage according to the given id Unit
removeResult(String resultId)
Removes the result from the storage according to the given id Unit
clear()
Removes all the results from the storage -
-
Method Detail
-
getAcceptedType
Class<CheckRecognizerResult> getAcceptedType()
-
putResult
Unit putResult(String resultId, CheckRecognizerResult result)
Puts the given result to the storage on the given id
- Parameters:
resultId
- id to store the result onresult
- result to store
-
getResult
CheckRecognizerResult getResult(String resultId)
Returns the result from the storage according to the given id
- Parameters:
resultId
- id to return the result from
-
removeResult
Unit removeResult(String resultId)
Removes the result from the storage according to the given id
- Parameters:
resultId
- id to remove the result on
-
-
-
-