Package io.scanbot.sdk.barcode.ui.result
Class BarcodeScannerUiResultInternalLruStorage
-
- All Implemented Interfaces:
-
io.scanbot.sdk.ui.result.ResultStorage
public final class BarcodeScannerUiResultInternalLruStorage implements ResultStorage<BarcodeScannerUiResultInternal>
Stores and provides access to the scanning 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 IntegerLRU_CACHE_SIZEpublic final static IntegerBARCODE_DATA_MULTIPLIERprivate final Class<BarcodeScannerUiResultInternal>acceptedType
-
Constructor Summary
Constructors Constructor Description BarcodeScannerUiResultInternalLruStorage()
-
Method Summary
Modifier and Type Method Description Class<BarcodeScannerUiResultInternal>getAcceptedType()UnitputResult(String resultId, BarcodeScannerUiResultInternal result)Puts the given result to the storage on the given id BarcodeScannerUiResultInternalgetResult(String resultId)Returns the result from the storage according to the given id UnitremoveResult(String resultId)Removes the result from the storage according to the given id Unitclear()Removes all the results from the storage -
-
Method Detail
-
getAcceptedType
Class<BarcodeScannerUiResultInternal> getAcceptedType()
-
putResult
Unit putResult(String resultId, BarcodeScannerUiResultInternal result)
Puts the given result to the storage on the given id
- Parameters:
resultId- id to store the result onresult- result to store
-
getResult
BarcodeScannerUiResultInternal 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
-
-
-
-