Package icyllis.modernui.util
Class Pools
java.lang.Object
icyllis.modernui.util.Pools
Helper class for creating pools of objects.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Interface for managing a pool of objects.static class
Simple (non-synchronized) pool of objects.static class
Synchronized pool of objects. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Pools.Pool
<T> newSimplePool
(int maxPoolSize) Creates a simple (non-synchronized) pool of objects.static <T> Pools.Pool
<T> newSynchronizedPool
(int maxPoolSize) Creates a synchronized pool of objects.static <T> Pools.Pool
<T> newSynchronizedPool
(int maxPoolSize, Object lock) Creates a synchronized pool of objects.
-
Method Details
-
newSimplePool
Creates a simple (non-synchronized) pool of objects.- Parameters:
maxPoolSize
- The max pool size.- Throws:
IllegalArgumentException
- If the max pool size is less than zero.
-
newSynchronizedPool
Creates a synchronized pool of objects.- Parameters:
maxPoolSize
- The max pool size.- Throws:
IllegalArgumentException
- If the max pool size is less than zero.
-
newSynchronizedPool
Creates a synchronized pool of objects.- Parameters:
maxPoolSize
- The max pool size.- Throws:
IllegalArgumentException
- If the max pool size is less than zero.
-