Most visited

Recently visited

Pools

public final class Pools
extends Object

java.lang.Object
   ↳ android.support.v4.util.Pools


用于装箱对象的助手类。 一个示例用法如下所示:

 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); } . . . } 
      
     
     
     

Summary

Nested classes

interface Pools.Pool<T>

管理对象池的界面。

class Pools.SimplePool<T>

简单(非同步)的对象池。

class Pools.SynchronizedPool<T>

同步)对象池。

Inherited methods

From class java.lang.Object

Hooray!