libgdx/libgdx — pull request #428 by PrinceManfred (2013-05-27 21:53:12+00:00)
Title: Pool Cell objects in Tables

I've added a new Pool implementation, SimplePool, and used it to pool Cell objects in BaseTableLayout.

A new ArrayList was added to BaseTableLayout to track cells created for rows and columns.

When clear is called in BaseTableLayout the Cells are returned to the pool.

Cell now implements Poolable so the values, other than layout, can be reset. layout is a final variable and I decided to keep it that way. This means each BaseTableLayout instance has its own SimplePool since the layout can't be changed. Adding a getter and setter for layout to Cell would let us have a static SimplePool for BaseTableLayout which might be a little more memory efficient.

Hope it's useful. Cheers :)