public abstract class ObjectPool<T> extends Object
| Constructor and Description |
|---|
ObjectPool(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
create() |
static <T> ObjectPool<T> |
create(Class<T> cls,
int capacity)
create an ObjectPool that uses the default constructor of the passed
class
|
T |
get() |
void |
put(T o) |
T |
refresh(T o) |
protected boolean |
reset(T object)
reset an object, e.g.
|
public static <T> ObjectPool<T> create(Class<T> cls, int capacity)
public T get()
public void put(T o)
put - object back on stackprotected boolean reset(T object)
Collection.clear()object - false if object shouldn't be reusedCopyright © 2014 Molindo GmbH. All Rights Reserved.