Class TilePlaceholder.BufferRef
java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.WeakReference<DataBuffer>
org.apache.sis.internal.coverage.j2d.TilePlaceholder.BufferRef
- All Implemented Interfaces:
Disposable
- Enclosing class:
- TilePlaceholder
private static final class TilePlaceholder.BufferRef
extends WeakReference<DataBuffer>
implements Disposable
Weak reference to a data buffer. The enclosing
TilePlaceholder is protected
from garbage collection as long as the weak reference is live.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TilePlaceholderPrevents the enclosing class to be garbage-collected too early by theTilePlaceholder.CACHE. -
Constructor Summary
ConstructorsConstructorDescriptionBufferRef(TilePlaceholder owner, DataBuffer buffer) Creates a new reference to the given buffer. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Allows the enclosingTilePlaceholderto be garbage-collected.Methods inherited from class java.lang.ref.Reference
clear, enqueue, get, isEnqueued
-
Field Details
-
owner
Prevents the enclosing class to be garbage-collected too early by theTilePlaceholder.CACHE. If theDataBufferis still referenced by someRaster, then we need theTilePlaceholderto continue to exist in theTilePlaceholder.CACHEin order to be able to reuse thatDataBuffer.
-
-
Constructor Details
-
BufferRef
BufferRef(TilePlaceholder owner, DataBuffer buffer) Creates a new reference to the given buffer.
-
-
Method Details
-
dispose
public void dispose()Allows the enclosingTilePlaceholderto be garbage-collected.- Specified by:
disposein interfaceDisposable
-