Lines Matching refs:instance
28 * MyPooledClass instance = sPool.acquire();
29 * return (instance != null) ? instance : new MyPooledClass();
53 * @return An instance from the pool if such, null otherwise.
58 * Release an instance to the pool.
60 * @param instance The instance to release.
61 * @return Whether the instance was put in the pool.
63 * @throws IllegalStateException If the instance is already in the pool.
65 public boolean release(T instance);
83 * Creates a new instance.
101 T instance = (T) mPool[lastPooledIndex];
104 return instance;
110 public boolean release(T instance) {
111 if (isInPool(instance)) {
115 mPool[mPoolSize] = instance;
122 private boolean isInPool(T instance) {
124 if (mPool[i] == instance) {
141 * Creates a new instance.