|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.util.lifecycle.impl.RecyclableImpl<T>
public class RecyclableImpl<T>
A basic example implementation of Recyclable
.
It will simply store key
and objectFactory
.
A call to recycle()
will result in a call to Recycler.pushBack(Object, ObjectCreatable)
with
this
as second argument.
The objectFactory
will be tested whether it implements the Recycler
interface before a call to
Recycler.pushBack(Object, ObjectCreatable)
is performed.
Field Summary | |
---|---|
protected T |
key
|
protected ObjectFactory<T> |
objectFactory
|
Constructor Summary | |
---|---|
RecyclableImpl()
|
Method Summary | |
---|---|
void |
recycle()
When the lifecycle of an object is over, this method must be called to return it to the Recycler for
later use. |
void |
setKey(T key)
Specify key for the object. |
void |
setObjectFactory(ObjectFactory<T> factory)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected T key
protected ObjectFactory<T> objectFactory
Constructor Detail |
---|
public RecyclableImpl()
Method Detail |
---|
public void recycle()
Recyclable
Recycler
for
later use.
recycle
in interface Recyclable<T>
public void setKey(T key)
Recyclable
setKey
in interface Recyclable<T>
key
- The key used to create the object from the factory.public void setObjectFactory(ObjectFactory<T> factory)
setObjectFactory
in interface ObjectCreatable<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |