java.lang.Object
com.fastasyncworldedit.core.queue.implementation.chunk.ChunkCache<T>
All Implemented Interfaces:
IChunkCache<T>, Trimable

public class ChunkCache<T extends Trimable> extends Object implements IChunkCache<T>
  • Field Details

    • getCache

      protected final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<WeakReference<T extends Trimable>> getCache
  • Constructor Details

  • Method Details

    • get

      public T get(int x, int z)
      Get or create the IGetBlocks.
      Specified by:
      get in interface IChunkCache<T extends Trimable>
      Returns:
      cached IGetBlocks
    • newChunk

      public T newChunk(int chunkX, int chunkZ)
    • trim

      public boolean trim(boolean aggressive)
      Description copied from interface: Trimable
      Trims the object, reducing its memory footprint.
      Specified by:
      trim in interface IChunkCache<T extends Trimable>
      Specified by:
      trim in interface Trimable
      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