|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jmex.pool.ObjectPool<T>
public class ObjectPool<T>
ObjectPool
allows re-use of Objects.
Constructor Summary | |
---|---|
ObjectPool(java.lang.Class<T> c,
int preAllocate)
|
|
ObjectPool(ObjectGenerator<T> generator,
int preAllocate)
|
Method Summary | |
---|---|
int |
available()
Retrieves the number of objects available in the queue. |
T |
get()
Retrieves the first available object in the pool or creates a new instance if there are none available. |
protected T |
newInstance()
|
boolean |
release(T t)
Releases the object back into the pool for re-use. |
T |
request()
Retrieves the first available object in the pool or returns null if none are available. |
int |
size()
Returns the actual number of T's created by this ObjectPool. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectPool(ObjectGenerator<T> generator, int preAllocate)
public ObjectPool(java.lang.Class<T> c, int preAllocate)
Method Detail |
---|
protected T newInstance()
public T get()
public T request() throws java.lang.Exception
java.lang.Exception
public boolean release(T t)
t
-
public int available()
public int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |