loci.formats.cache

## Interface ICacheStrategy

- All Superinterfaces:
    CacheReporter
  All Known Implementing Classes:
    CacheStrategy, CrosshairStrategy, RectangleStrategy

      public interface ICacheStrategy
      extends CacheReporter

  Interface for cache strategies. A cache strategy identifies which objects should be loaded into the cache, in which order. Unlike `ICacheSource`, it works with multidimensional (N-D) position arrays rather than rasterized (1-D) indices. The two are made equivalent via a mapping between the two, invoked within `Cache` as needed.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `BACKWARD_ORDER`
    `static int` | `CENTERED_ORDER`
    `static int` | `FORWARD_ORDER`
    `static int` | `HIGH_PRIORITY`
    `static int` | `LOW_PRIORITY`
    `static int` | `MAX_PRIORITY`
    `static int` | `MIN_PRIORITY`
    `static int` | `NORMAL_PRIORITY`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int[]` | `getLengths()` Gets the lengths of all the axes.
    `int[][]` | `getLoadList(int[] pos)` Gets the indices of the objects to cache, surrounding the object at the given position.
    `int[]` | `getOrder()` Retrieves the order in which objects should be loaded along each axis.
    `int[]` | `getPriorities()` Retrieves the priority for caching each axis.
    `int[]` | `getRange()` Retrieves the number of objects to cache along each axis.
    `void` | `setOrder(int order, int axis)` Sets the order in which objects should be loaded along each axis.
    `void` | `setPriority(int priority, int axis)` Sets the priority for caching the given axis.
    `void` | `setRange(int num, int axis)` Sets the number of objects to cache along the given axis.

    - ### Methods inherited from interface loci.formats.cache.CacheReporter

      `addCacheListener, getCacheListeners, removeCacheListener`

- - ### Field Detail

    - #### MIN_PRIORITY

          static final int MIN_PRIORITY

      See Also:
        Constant Field Values

    - #### LOW_PRIORITY

          static final int LOW_PRIORITY

      See Also:
        Constant Field Values

    - #### NORMAL_PRIORITY

          static final int NORMAL_PRIORITY

      See Also:
        Constant Field Values

    - #### HIGH_PRIORITY

          static final int HIGH_PRIORITY

      See Also:
        Constant Field Values

    - #### MAX_PRIORITY

          static final int MAX_PRIORITY

      See Also:
        Constant Field Values

    - #### CENTERED_ORDER

          static final int CENTERED_ORDER

      See Also:
        Constant Field Values

    - #### FORWARD_ORDER

          static final int FORWARD_ORDER

      See Also:
        Constant Field Values

    - #### BACKWARD_ORDER

          static final int BACKWARD_ORDER

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getLoadList

          int[][] getLoadList(int[] pos)
                       throws CacheException

      Gets the indices of the objects to cache, surrounding the object at the given position.
      Throws:
        `CacheException`

    - #### getPriorities

          int[] getPriorities()

      Retrieves the priority for caching each axis.

    - #### setPriority

          void setPriority(int priority,
                           int axis)

      Sets the priority for caching the given axis.

    - #### getOrder

          int[] getOrder()

      Retrieves the order in which objects should be loaded along each axis.
      Returns:
        An array whose constituents are each one of:
        - CENTERED_ORDER
        - FORWARD_ORDER
        - BACKWARD_ORDER

    - #### setOrder

          void setOrder(int order,
                        int axis)

      Sets the order in which objects should be loaded along each axis.
      Parameters:
        `order` - One of:
        - CENTERED_ORDER
        - FORWARD_ORDER
        - BACKWARD_ORDER
        `axis` - The axis for which to set the order.

    - #### getRange

          int[] getRange()

      Retrieves the number of objects to cache along each axis.

    - #### setRange

          void setRange(int num,
                        int axis)

      Sets the number of objects to cache along the given axis.

    - #### getLengths

          int[] getLengths()

      Gets the lengths of all the axes.

Copyright © 2026 Open Microscopy Environment