Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Pool

[18:7] extends: FxObj

Wraps FXGL's Pool (com.almasb.fxgl.core.pool.Pool), the abstract base for a reusable object pool. Aussom users that need a custom pool wrap an existing Pool AJO (e.g. returned by another FXGL API); authoring a brand-new Pool subclass from Aussom requires implementing the abstract newObject() method, which is a future Java-bridge addition. This wrapper exposes the obtain / free / clear surface that works on any existing Pool instance.

Methods

  • Pool ()

    Empty default constructor; populated by adopt.

  • adopt (object Ajo)

    Wraps an existing Pool AussomJavaObject.

    • @p Ajo is an AussomJavaObject around a Pool.
    • @r A new wrapper.
  • obtain ()

    Returns a pooled instance (new if the pool is empty).

    • @r An AussomJavaObject around the pooled instance.
  • free (object ObjAjo)

    Returns the object to the pool. Invokes its reset() if Poolable.

    • @p ObjAjo is the object to return.
    • @r this object
  • clear ()

    Clears every free object from the pool.

    • @r this object