- java.lang.Object
-
- ch.bind.philib.pool.object.PoolBase<T>
-
- All Implemented Interfaces:
Pool<T>
- Direct Known Subclasses:
SoftRefPool,StrongRefPool
public abstract class PoolBase<T> extends Object implements Pool<T>
- Author:
- Philipp Meinen
-
-
Constructor Summary
Constructors Constructor Description PoolBase(ObjectManager<T> manager)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclear()instructs the pool to destroy all pooled objects.PoolStatsgetPoolStats()protected abstract booleanoffer(T value)protected abstract Tpoll()voidrecycle(T value)Recycles an object which might be reused.Ttake()Take an object from the object-pool.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ch.bind.philib.pool.Pool
getNumPooled
-
-
-
-
Constructor Detail
-
PoolBase
public PoolBase(ObjectManager<T> manager)
-
-
Method Detail
-
take
public final T take()
Description copied from interface:PoolTake an object from the object-pool.
-
recycle
public final void recycle(T value)
Description copied from interface:PoolRecycles an object which might be reused. The caller must not use this object after calling this method.
-
clear
public final void clear()
Description copied from interface:Poolinstructs the pool to destroy all pooled objects.
-
getPoolStats
public final PoolStats getPoolStats()
- Specified by:
getPoolStatsin interfacePool<T>- Returns:
- This pool's statistics object. Calls to this pool's methods are visible to successive calls to this statics-object's methods.
-
poll
protected abstract T poll()
-
offer
protected abstract boolean offer(T value)
-
-