Package org.apache.velocity.util
Class SimplePool
- java.lang.Object
-
- org.apache.velocity.util.SimplePool
-
public final class SimplePool extends java.lang.ObjectSimple object pool. Based on ThreadPool and few other classes The pool will ignore overflow and return null if empty.- Version:
- $Id: SimplePool.java 463298 2006-10-12 16:10:32Z henning $
-
-
Constructor Summary
Constructors Constructor Description SimplePool(int max)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectget()Get an object from the pool, null if the pool is empty.intgetMax()Return the size of the pool(package private) java.lang.Object[]getPool()for testing purposes, so we can examine the poolvoidput(java.lang.Object o)Add the object to the pool, silent nothing if the pool is full
-
-
-
Method Detail
-
put
public void put(java.lang.Object o)
Add the object to the pool, silent nothing if the pool is full- Parameters:
o-
-
get
public java.lang.Object 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
java.lang.Object[] getPool()
for testing purposes, so we can examine the pool- Returns:
- Array of Objects in the pool.
-
-