# Pools.Pool

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1  
Summary:[Methods](https://developer.android.com/reference/android/support/v4/util/Pools.Pool#pubmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4/util/Pools.Pool#)  

# Pools.Pool

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public
static


interface
Pools.Pool
`  
`


`

|-----------------------------------------|
| android.support.v4.util.Pools.Pool\<T\> |

|---|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/util/Pools.Pool#)Known Indirect Subclasses [Pools.SimplePool](https://developer.android.com/reference/android/support/v4/util/Pools.SimplePool)\<T\>,[Pools.SynchronizedPool](https://developer.android.com/reference/android/support/v4/util/Pools.SynchronizedPool)\<T\> |-----------------------------------------------------------------------------------------------------------------------|--------------------------------------------| | [Pools.SimplePool](https://developer.android.com/reference/android/support/v4/util/Pools.SimplePool)\<T\>             | Simple (non-synchronized) pool of objects. | | [Pools.SynchronizedPool](https://developer.android.com/reference/android/support/v4/util/Pools.SynchronizedPool)\<T\> | Synchronized) pool of objects.             | ||

<br />

*** ** * ** ***

Interface for managing a pool of objects.

## Summary

|                                                                            ### Public methods                                                                            ||
|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract T`       | ` `[acquire](https://developer.android.com/reference/android/support/v4/util/Pools.Pool#acquire())`() `                                             |
| ` abstract boolean` | ` `[release](https://developer.android.com/reference/android/support/v4/util/Pools.Pool#release(T))`(T instance) ` Release an instance to the pool. |

## Public methods

### acquire

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
T acquire ()
```

<br />

<br />

|                            Returns                             ||
|-----|-----------------------------------------------------------|
| `T` | An instance from the pool if such, null otherwise. <br /> |

### release

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean release (T instance)
```

Release an instance to the pool.

<br />

|                    Parameters                    ||
|------------|--------------------------------------|
| `instance` | `T`: The instance to release. <br /> |

|                           Returns                           ||
|-----------|--------------------------------------------------|
| `boolean` | Whether the instance was put in the pool. <br /> |

|                              Throws                              ||
|-------------------------|-----------------------------------------|
| `IllegalStateException` | If the instance is already in the pool. |

-

  ## Interfaces

  - [Pools.Pool](https://developer.android.com/reference/android/support/v4/util/Pools.Pool)
-

  ## Classes

  - [ArrayMap](https://developer.android.com/reference/android/support/v4/util/ArrayMap)
  - [ArraySet](https://developer.android.com/reference/android/support/v4/util/ArraySet)
  - [AtomicFile](https://developer.android.com/reference/android/support/v4/util/AtomicFile)
  - [CircularArray](https://developer.android.com/reference/android/support/v4/util/CircularArray)
  - [CircularIntArray](https://developer.android.com/reference/android/support/v4/util/CircularIntArray)
  - [LongSparseArray](https://developer.android.com/reference/android/support/v4/util/LongSparseArray)
  - [LruCache](https://developer.android.com/reference/android/support/v4/util/LruCache)
  - [ObjectsCompat](https://developer.android.com/reference/android/support/v4/util/ObjectsCompat)
  - [Pair](https://developer.android.com/reference/android/support/v4/util/Pair)
  - [PatternsCompat](https://developer.android.com/reference/android/support/v4/util/PatternsCompat)
  - [Pools](https://developer.android.com/reference/android/support/v4/util/Pools)
  - [Pools.SimplePool](https://developer.android.com/reference/android/support/v4/util/Pools.SimplePool)
  - [Pools.SynchronizedPool](https://developer.android.com/reference/android/support/v4/util/Pools.SynchronizedPool)
  - [SimpleArrayMap](https://developer.android.com/reference/android/support/v4/util/SimpleArrayMap)
  - [SparseArrayCompat](https://developer.android.com/reference/android/support/v4/util/SparseArrayCompat)