Interface Trimable

All Known Subinterfaces:
IBlocks, IChunk, IChunkCache<T>, IChunkGet, IChunkSet, IQueueChunk<T>, IQueueExtent<T>, SimpleWorld, World
All Known Implementing Classes:
AbstractWorld, BitSetBlocks, CharBlocks, CharGetBlocks, CharSetBlocks, ChunkCache, ChunkHolder, FaweCache, NullChunk, NullChunkGet, NullWorld, QueueHandler, SingleThreadQueueExtent, WorldWrapper

public interface Trimable
Interface for objects that can be trimmed (memory related). Trimming will reduce its memory footprint.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
     
    boolean
    trim(boolean aggressive)
    Trims the object, reducing its memory footprint.
  • Method Details

    • trim

      boolean trim(boolean aggressive)
      Trims the object, reducing its memory footprint.
      Parameters:
      aggressive - if trimming should be aggressive e.g., Not returning early when the first element cannot be trimmed
      Returns:
      if this object is empty at the end of the trim, and can therefore be deleted
    • recycle

      default void recycle()