Package icyllis.modernui.util

# Class Pools

java.lang.Object
icyllis.modernui.util.Pools

public final class Pools extends Object
Helper class for creating pools of objects.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `Pools.Pool<T>`
  Interface for managing a pool of objects.
  `static class`
  `Pools.SimplePool<T>`
  Simple (non-synchronized) pool of objects.
  `static class`
  `Pools.SynchronizedPool<T>`
  Synchronized pool of objects.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static <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.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### newSimplePool

    @NonNull public static <T> Pools.Pool<T> newSimplePool(int maxPoolSize)
    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

    @NonNull public static <T> Pools.Pool<T> newSynchronizedPool(int maxPoolSize)
    Creates a synchronized pool of objects.
    Parameters:
      `maxPoolSize` - The max pool size.
    Throws:
      `IllegalArgumentException` - If the max pool size is less than zero.

  - ### newSynchronizedPool

    @NonNull public static <T> Pools.Pool<T> newSynchronizedPool(int maxPoolSize, @NonNull Object lock)
    Creates a synchronized pool of objects.
    Parameters:
      `maxPoolSize` - The max pool size.
    Throws:
      `IllegalArgumentException` - If the max pool size is less than zero.