Class TilePlaceholder.BufferRef
java.lang.Object
java.lang.ref.Reference<DataBuffer>
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 TilePlaceholder
Prevents 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 TypeMethodDescriptionvoid
dispose()
Allows the enclosingTilePlaceholder
to be garbage-collected.Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, get, isEnqueued, reachabilityFence, refersTo
-
Field Details
-
owner
Prevents the enclosing class to be garbage-collected too early by theTilePlaceholder.CACHE
. If theDataBuffer
is still referenced by someRaster
, then we need theTilePlaceholder
to continue to exist in theTilePlaceholder.CACHE
in 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 enclosingTilePlaceholder
to be garbage-collected.- Specified by:
dispose
in interfaceDisposable
-