public class CoverageReferences extends Object
reference(org.opengis.coverage.Coverage)method with the same
Coverageinstance will return the same
WeakReferenceinstance. If all weak references to a coverage have been created by the same instance of
DEFAULTone), then it is guaranteed that given:
then testingCoverage coverageA = ...; Coverage coverageB = ...; WeakReference<Coverage> refA = reference(coverageA); WeakReference<Coverage> refB = reference(coverageB);
(refA == refB)is equivalent to testing
(coverageA == coverageB)Comparing the references instead than the coverages can keep comparisons mainfull even after the coverages have been garbage collected. This is sometime useful for checking if two results of a calculation were done using the same coverage inputs, without preventing garbage-collection of those coverages.
Because a weak references created by this class may be shared by many, invoking
Reference.clear() on them has no effect. Only the garbage-collector can
clear the references.
Defined in the
|Modifier and Type||Field and Description|
The default, system-wide weak references for coverages.
|Modifier||Constructor and Description|
Creates a new coverage cache.
|Modifier and Type||Method and Description|
Returns a weak reference to the specified coverage.
DEFAULTinstance should be used instead.
WeakReferenceis created and returned.
coverage- The coverage to reference.
Copyright © 2009–2017 Geotoolkit.org. All rights reserved.