Class LruArrayPool
- java.lang.Object
-
- com.bumptech.glide.load.engine.bitmap_recycle.LruArrayPool
-
-
Field Summary
-
Fields inherited from interface com.bumptech.glide.load.engine.bitmap_recycle.ArrayPool
STANDARD_BUFFER_SIZE_BYTES
-
-
Constructor Summary
Constructors Constructor Description LruArrayPool()LruArrayPool(int maxSize)Constructor for a new pool.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclearMemory()Clears all arrays from the pool.<T> Tget(int size, java.lang.Class<T> arrayClass)Returns a non-null array of the given type with a length>=to the given size.<T> TgetExact(int size, java.lang.Class<T> arrayClass)Returns a non-null array of the given type with a length exactly equal to the given size.<T> voidput(T array)Optionally adds the given array of the given type to the pool.<T> voidput(T array, java.lang.Class<T> arrayClass)Deprecated.voidtrimMemory(int level)Trims the size to the appropriate level.
-
-
-
Method Detail
-
put
@Deprecated public <T> void put(T array, java.lang.Class<T> arrayClass)Deprecated.Description copied from interface:ArrayPoolOptionally adds the given array of the given type to the pool.Arrays may be ignored, for example if the array is larger than the maximum size of the pool.
-
put
public <T> void put(T array)
Description copied from interface:ArrayPoolOptionally adds the given array of the given type to the pool.Arrays may be ignored, for example if the array is larger than the maximum size of the pool.
-
getExact
public <T> T getExact(int size, java.lang.Class<T> arrayClass)Description copied from interface:ArrayPoolReturns a non-null array of the given type with a length exactly equal to the given size.If an array of the given size isn't in the pool, a new one will be allocated.
This class makes no guarantees about the contents of the returned array.
- Specified by:
getExactin interfaceArrayPool- See Also:
ArrayPool.get(int, Class)
-
get
public <T> T get(int size, java.lang.Class<T> arrayClass)Description copied from interface:ArrayPoolReturns a non-null array of the given type with a length>=to the given size.If an array of the given size isn't in the pool, a new one will be allocated.
This class makes no guarantees about the contents of the returned array.
- Specified by:
getin interfaceArrayPool- See Also:
ArrayPool.getExact(int, Class)
-
clearMemory
public void clearMemory()
Description copied from interface:ArrayPoolClears all arrays from the pool.- Specified by:
clearMemoryin interfaceArrayPool
-
trimMemory
public void trimMemory(int level)
Description copied from interface:ArrayPoolTrims the size to the appropriate level.- Specified by:
trimMemoryin interfaceArrayPool- Parameters:
level- A trim specified inComponentCallbacks2.
-
-