FileDocCategorySizeDatePackage
Pools.javaAPI DocAndroid 5.1 API4508Thu Mar 12 22:22:10 GMT 2015android.util

Pools

public final class Pools extends Object
Helper class for crating pools of objects. An example use looks like this:
public class MyPooledClass {

private static final SynchronizedPool sPool =
new SynchronizedPool(10);

public static MyPooledClass obtain() {
MyPooledClass instance = sPool.acquire();
return (instance != null) ? instance : new MyPooledClass();
}

public void recycle() {
// Clear state if needed.
sPool.release(this);
}

. . .
}
hide

Fields Summary
Constructors Summary
private Pools()

        /* do nothing - hiding constructor */
    
Methods Summary