-
public interface ArrayPoolInterface for an array pool that pools arrays of different types.
-
-
Method Summary
Modifier and Type Method Description abstract <T> voidput(T array, Class<T> arrayClass)Optionally adds the given array of the given type to the pool. abstract <T> voidput(T array)Optionally adds the given array of the given type to the pool. abstract <T> Tget(int size, Class<T> arrayClass)Returns a non-null array of the given type with a length >= to the given size. abstract <T> TgetExact(int size, Class<T> arrayClass)Returns a non-null array of the given type with a length exactly equal to the given size. abstract voidclearMemory()Clears all arrays from the pool. abstract voidtrimMemory(int level)Trims the size to the appropriate level. -
-
Method Detail
-
put
@Deprecated() abstract <T> void put(T array, Class<T> arrayClass)
Optionally 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
abstract <T> void put(T array)
Optionally 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.
-
get
abstract <T> T get(int size, Class<T> arrayClass)
Returns 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.
-
getExact
abstract <T> T getExact(int size, Class<T> arrayClass)
Returns 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.
-
clearMemory
abstract void clearMemory()
Clears all arrays from the pool.
-
trimMemory
abstract void trimMemory(int level)
Trims the size to the appropriate level.
- Parameters:
level- A trim specified in android.content.ComponentCallbacks2.
-
-
-
-