Lines Matching defs:instance
30 * MyPooledClass instance = sPool.acquire();
31 * return (instance != null) ? instance : new MyPooledClass();
54 * @return An instance from the pool if such, null otherwise.
59 * Release an instance to the pool.
61 * @param instance The instance to release.
62 * @return Whether the instance was put in the pool.
64 * @throws IllegalStateException If the instance is already in the pool.
66 public boolean release(T instance);
84 * Creates a new instance.
102 T instance = (T) mPool[lastPooledIndex];
105 return instance;
111 public boolean release(T instance) {
112 if (isInPool(instance)) {
116 mPool[mPoolSize] = instance;
123 private boolean isInPool(T instance) {
125 if (mPool[i] == instance) {
142 * Creates a new instance.