Package org.apache.velocity.util
Class SimplePool
- java.lang.Object
-
- org.apache.velocity.util.SimplePool
-
public final class SimplePool extends Object
Simple object pool. Based on ThreadPool and few other classes The pool will ignore overflow and return null if empty.- Version:
- $Id$
- Author:
- Gal Shachor, Costin, Geir Magnusson Jr.
-
-
Constructor Summary
Constructors Constructor Description SimplePool(int max)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
get()
Get an object from the pool, null if the pool is empty.int
getMax()
Return the size of the poolvoid
put(Object o)
Add the object to the pool, silent nothing if the pool is full
-
-
-
Method Detail
-
put
public void put(Object o)
Add the object to the pool, silent nothing if the pool is full- Parameters:
o
-
-
get
public 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.
-
-