Package org.ddogleg.struct
Class RecycleManager<T>
java.lang.Object
org.ddogleg.struct.RecycleManager<T>
- Direct Known Subclasses:
RecycleManagerL
Simple class which helps minimize declaring new objects by helping you recycle them.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected T
Creates a new instance using the class.Returns the stack containing all the unused instances.void
recycleInstance
(T object) Call when an instance is no longer needed and can be recycledEither returns a recycled instance or a new one.
-
Field Details
-
targetClass
-
unused
-
-
Constructor Details
-
RecycleManager
-
-
Method Details
-
requestInstance
Either returns a recycled instance or a new one. -
recycleInstance
Call when an instance is no longer needed and can be recycled -
createInstance
Creates a new instance using the class. overload this to handle more complex constructors -
getUnused
Returns the stack containing all the unused instances.
-