Class ChunkCache<T extends Trimable>
java.lang.Object
com.fastasyncworldedit.core.queue.implementation.chunk.ChunkCache<T>
- All Implemented Interfaces:
IChunkCache<T>
,Trimable
-
Field Summary
Modifier and TypeFieldDescriptionprotected final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<WeakReference<T>>
-
Constructor Summary
-
Method Summary
-
Field Details
-
getCache
protected final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<WeakReference<T extends Trimable>> getCache
-
-
Constructor Details
-
ChunkCache
-
-
Method Details
-
get
Get or create the IGetBlocks.- Specified by:
get
in interfaceIChunkCache<T extends Trimable>
- Returns:
- cached IGetBlocks
-
newChunk
-
trim
public boolean trim(boolean aggressive) Description copied from interface:Trimable
Trims the object, reducing its memory footprint.- Specified by:
trim
in interfaceIChunkCache<T extends Trimable>
- Specified by:
trim
in interfaceTrimable
- 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
-