Class DeferredProperty

java.lang.Object
org.apache.sis.internal.coverage.j2d.DeferredProperty

public final class DeferredProperty extends Object
An image property for which the computation is differed. This special kind of properties is recognized by the following methods:
Since:
1.1
Version:
1.1
  • Field Details

    • value

      private Object value
      The value, or null if not yet computed.
    • provider

      private Function<RenderedImage,?> provider
      The function computing the value. This function is reset to null after the value has been computed for allowing the garbage collector to do its work.
  • Constructor Details

    • DeferredProperty

      public DeferredProperty(Function<RenderedImage,?> provider)
      Creates a new deferred property.
      Parameters:
      provider - function computing the value.
  • Method Details

    • compute

      final Object compute(RenderedImage image)
      Returns the property value, which is computed when this method is first invoked.
      Parameters:
      image - the image for which to compute the property value.
      Returns:
      the property value, or null if it cannot be computed.
    • forGridGeometry

      public static Map<String,Object> forGridGeometry(GridGeometry grid, int[] dimensions)
      Creates a deferred property for computing the value of PlanarImage.GRID_GEOMETRY_KEY.
      Parameters:
      grid - the grid geometry of the grid coverage rendered as an image.
      dimensions - the dimensions to keep from the coverage grid geometry.
      Returns:
      a deferred property for computing the grid geometry of an image.