|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xml.utils.ObjectPool
Pool of object of a given type to pick from to help memory usage
Field Summary | |
private Vector |
freeStack
Vector of given objects this points to. |
private Class |
objectType
Type of objects in this pool. |
Constructor Summary | |
ObjectPool()
Constructor ObjectPool |
|
ObjectPool(Class type)
Constructor ObjectPool |
|
ObjectPool(Class type,
int size)
Constructor ObjectPool |
|
ObjectPool(String className)
Constructor ObjectPool |
Method Summary | |
void |
freeInstance(Object obj)
Add an instance of the given object to the pool |
Object |
getInstance()
Get an instance of the given object in this pool |
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 |
private final Class objectType
private final Vector freeStack
Constructor Detail |
public ObjectPool(Class type)
type
- Type of objects for this poolpublic ObjectPool(String className)
className
- Fully qualified name of the type of objects for this pool.public ObjectPool(Class type, int size)
type
- Type of objects for this poolsize
- Size of vector to allocatepublic ObjectPool()
Method Detail |
public Object getInstanceIfFree()
public Object getInstance()
public void freeInstance(Object obj)
obj
- Object to add.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |