public interface TypedRecycling<T>
extends org.refcodes.collection.Clearable
TypedRecycling
interface takes once
created instances back and will recycle them in terms of reusing: When a new
instance is to be created and the factory contains recycled instances, then
first recycled instances are returned till there are no more such instances
available. Only then new instances are created.
In case an instance to be recycled implements the Clearable
interface, then the provided instance is cleared by invoking the
Clearable.clear()
method. In case an instance to be recycled
implements the Resetable
interface, then the provided instance is
reseted by invoking the Resetable.reset()
method.
Modifier and Type | Method and Description |
---|---|
void |
recycleInstance(T aInstance)
Makes the provided instance available for reuse by the factory.
|
void recycleInstance(T aInstance)
Clearable
interface, then the provided instance is cleared by invoking the
Clearable.clear()
method. In case an instance to be recycled
implements the Resetable
interface, then the provided instance is
reseted by invoking the Resetable.reset()
method.aInstance
- The object to be recycled and offered fore reuse.Copyright © 2016. All rights reserved.