Class AbstractInstancer<I extends Instance>

java.lang.Object
com.jozufozu.flywheel.backend.engine.AbstractInstancer<I>
All Implemented Interfaces:
Instancer<I>
Direct Known Subclasses:
IndirectInstancer, InstancedInstancer

public abstract class AbstractInstancer<I extends Instance> extends Object implements Instancer<I>
  • Field Details

  • Constructor Details

  • Method Details

    • createInstance

      public I createInstance()
      Specified by:
      createInstance in interface Instancer<I extends Instance>
      Returns:
      a handle to a new copy of this model.
    • stealInstance

      public void stealInstance(@Nullable I instance)
      Description copied from interface: Instancer
      Steal an instance from another instancer.
      This has the effect of swapping the instance's model in-place.

      If the given instance is already owned by this instancer, this method does nothing.
      If the given instance is null, this method does nothing.
      If the given instance was created by a different backend, the behavior of this method is undefined.
      Specified by:
      stealInstance in interface Instancer<I extends Instance>
      Parameters:
      instance - The instance to steal.
    • instanceCount

      public int instanceCount()
    • notifyDirty

      public void notifyDirty(int index)
    • notifyRemoval

      public void notifyRemoval(int index)
    • removeDeletedInstances

      protected void removeDeletedInstances()
    • clear

      public void clear()
      Clear all instances without freeing resources.
    • delete

      public void delete()
    • toString

      public String toString()
      Overrides:
      toString in class Object