public abstract class ObjectPool<T>
extends java.lang.Object
| Constructor and Description |
|---|
ObjectPool(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
create() |
static <T> ObjectPool<T> |
create(java.lang.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(java.lang.Class<T> cls, int capacity)
public T get()
public void put(T o)
put - object back on stack@Nonnull protected abstract T create()
protected boolean reset(T object)
Collection.clear()object - false if object shouldn't be reusedCopyright © 2015 Molindo GmbH. All Rights Reserved.