|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrcx.josx.util.Recycler
public abstract class Recycler
An abstract object recycler. This class should be extended to define the createInstance method for a particular kind of Recyclable.
Note that the caller is expected to provide thread safety for instances of this class.
Recyclable| Constructor Summary | |
|---|---|
Recycler()
Constructs a recycler. |
|
| Method Summary | |
|---|---|
Recyclable |
allocate()
Attempts to obtain a free object. |
void |
recycle(Recyclable r)
Reclaims a Recyclable previously allocated with the allocate method. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Recycler()
capacity - Maximum number of allocated (non garbage) objects at any given time.| Method Detail |
|---|
public final Recyclable allocate()
public final void recycle(Recyclable r)
allocate method.
The release method of the Recyclable object
is invoked here.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||