Package icyllis.modernui.util
Class Pools.SimplePool<T>
java.lang.Object
icyllis.modernui.util.Pools.SimplePool<T>
- Type Parameters:
- T- The pooled type.
- All Implemented Interfaces:
- Pools.Pool<T>
- Direct Known Subclasses:
- Pools.SynchronizedPool
- Enclosing class:
- Pools
Simple (non-synchronized) pool of objects.
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Constructor Details- 
SimplePoolpublic SimplePool(int maxPoolSize) Creates a new instance.- Parameters:
- maxPoolSize- The max pool size.
- Throws:
- IllegalArgumentException- If the max pool size is less than zero.
 
 
- 
- 
Method Details- 
acquire- Specified by:
- acquirein interface- Pools.Pool<T>
- Returns:
- An instance from the pool if such, null otherwise.
 
- 
releaseDescription copied from interface:Pools.PoolRelease an instance to the pool.- Specified by:
- releasein interface- Pools.Pool<T>
- Parameters:
- instance- The instance to release.
- Returns:
- Whether the instance was put in the pool.
 
 
-