T- any class whose objects are stored in the pool
public class ObjectPool<T> extends Object
|Constructor and Description|
Creates a new object pool.
|Modifier and Type||Method and Description|
Returns an object from the (sub) pool, or
Prints statistics about hits and misses.
Puts an object into the specified subpool.
public ObjectPool(int subPools, int maxSizes)
subPools- the number of sub pools
maxSizes- the maximum size of each sub pool
public T get(int subPool)
nullif the pool is empty.
subPool- the number of the sub pool, starting with 0
public void recycle(T object, int subPool)
object- an object to store
subPool- the index of the sub pool (starting with 0)
public void printStats(PrintStream out)
out- a print stream to which the statistic should be written
KNIME GmbH, Konstanz, Germany
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.