amwebarsentitlementservice.elementpool
Class PoolManager
java.lang.Object
|
+--amwebarsentitlementservice.elementpool.PoolManager
- public class PoolManager
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_CAPACITY
public static final int DEFAULT_CAPACITY
LINEAR_GROWTH
public static final boolean LINEAR_GROWTH
LINEAR_GROWTH_BY
public static final int LINEAR_GROWTH_BY
PoolManager
public PoolManager(PoolElement prototype)
PoolManager
public PoolManager(int capacity,
PoolElement prototype)
PoolManager
public PoolManager(int capacity,
PoolElement prototype,
boolean growable)
- Constructor for PoolManager.
getElement
public PoolElement getElement()
- Retrieves a element of the PoolManager.
If the pool is empty and growth is allowed the pool's size is raised
by a fixed value or doubled.
- Returns:
- element of the pool
returnElement
public void returnElement(PoolElement element)
- Returns a element previously obtained from the pool back to it.
The elements status is cleared by calling the clearInternalStatus method
of the element.
- Parameters:
element
- PoolElement previously obtained
size
public int size()
isEmpty
public boolean isEmpty()
capacity
public int capacity()