Package org.fxmisc.flowless
Class CellPool<T,C extends Cell<T,?>>
java.lang.Object
org.fxmisc.flowless.CellPool<T,C>
Helper class that stores a pool of reusable cells that can be updated via
Cell.updateItem(Object)
or
creates new ones via its cellFactory
if the pool is empty.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
acceptCell
(C cell) Adds the cell to the pool of reusable cells ifCell.isReusable()
is true, ordisposes
the cell if it's not.void
dispose()
Disposes the cell pool and prevents any memory leaks.Returns a reusable cell that has been updated with the current item if the pool has one, or returns a newly-created one via itscellFactory
.
-
Field Details
-
cellFactory
-
pool
-
-
Constructor Details
-
CellPool
-
-
Method Details
-
getCell
Returns a reusable cell that has been updated with the current item if the pool has one, or returns a newly-created one via itscellFactory
. -
acceptCell
Adds the cell to the pool of reusable cells ifCell.isReusable()
is true, ordisposes
the cell if it's not. -
dispose
public void dispose()Disposes the cell pool and prevents any memory leaks.
-