Package org.apache.velocity.util
Class SimplePool
java.lang.Object
org.apache.velocity.util.SimplePool
Simple object pool. Based on ThreadPool and few other classes
The pool will ignore overflow and return null if empty.
- Version:
- $Id$
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
pool
-
max
private int maxmax amount of objects to be managed set via CTOR -
current
private int currentindex of previous to next free slot
-
-
Constructor Details
-
SimplePool
public SimplePool(int max) - Parameters:
max
-
-
-
Method Details
-
put
Add the object to the pool, silent nothing if the pool is full- Parameters:
o
-
-
get
Get an object from the pool, null if the pool is empty.- Returns:
- The object from the pool.
-
getMax
public int getMax()Return the size of the pool- Returns:
- The pool size.
-
getPool
Object[] getPool()for testing purposes, so we can examine the pool- Returns:
- Array of Objects in the pool.
-