net.sf.mmm.util.pool.base
Class AbstractNoPool<E>
java.lang.Object
net.sf.mmm.util.pool.base.AbstractNoPool<E>
- Type Parameters:
E - is the templated type of the elements in the pool.
- All Implemented Interfaces:
- Pool<E>
- Direct Known Subclasses:
- NoByteArrayPool, NoCharArrayPool
public abstract class AbstractNoPool<E>
- extends Object
- implements Pool<E>
This is the abstract base implementation of a dummy Pool that is
actually NOT pooling at all. It always creates a fresh instance on
Pool.borrow() and does nothing on release(Object).
- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
|
Method Summary |
boolean |
isEmpty()
This method determines if the pool is empty. |
void |
release(E element)
This method releases the given element. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.mmm.util.pool.api.Pool |
borrow |
AbstractNoPool
public AbstractNoPool()
- The constructor.
isEmpty
public boolean isEmpty()
- This method determines if the pool is empty.
- Specified by:
isEmpty in interface Pool<E>
- Returns:
true if the pool is empty.- See Also:
Collection.isEmpty()
release
public void release(E element)
- This method releases the given
element. It will be put back
into the pool.
ATTENTION:
Only call this method if you are sure that the given element
is NOT in use anymore. Therefore no reference should exist on the
element and you should NOT have passed the
element to a third-party library that may keep it in some
cache.
- Specified by:
release in interface Pool<E>
- Parameters:
element - is the element to add to the pool.- See Also:
Collection.add(Object)
Copyright © 2001-2010 mmm-Team. All Rights Reserved.