|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.xml.utils.ObjectPool
public class ObjectPool
Pool of object of a given type to pick from to help memory usage
| Field Summary | |
|---|---|
private java.util.ArrayList |
freeStack
Stack of given objects this points to. |
private java.lang.Class |
objectType
Type of objects in this pool. |
(package private) static long |
serialVersionUID
|
| Constructor Summary | |
|---|---|
ObjectPool()
Constructor ObjectPool |
|
ObjectPool(java.lang.Class type)
Constructor ObjectPool |
|
ObjectPool(java.lang.Class type,
int size)
Constructor ObjectPool |
|
ObjectPool(java.lang.String className)
Constructor ObjectPool |
|
| Method Summary | |
|---|---|
void |
freeInstance(java.lang.Object obj)
Add an instance of the given object to the pool |
java.lang.Object |
getInstance()
Get an instance of the given object in this pool |
java.lang.Object |
getInstanceIfFree()
Get an instance of the given object in this pool if available |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final long serialVersionUID
private final java.lang.Class objectType
private final java.util.ArrayList freeStack
| Constructor Detail |
|---|
public ObjectPool(java.lang.Class type)
type - Type of objects for this poolpublic ObjectPool(java.lang.String className)
className - Fully qualified name of the type of objects for this pool.
public ObjectPool(java.lang.Class type,
int size)
type - Type of objects for this poolsize - Size of vector to allocatepublic ObjectPool()
| Method Detail |
|---|
public java.lang.Object getInstanceIfFree()
public java.lang.Object getInstance()
public void freeInstance(java.lang.Object obj)
obj - Object to add.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||