Interface Localizable

All Superinterfaces:
EuclideanSpace, RealLocalizable
All Known Subinterfaces:
Cursor<T>, LocalizableSampler<T>, LocalizableSpliterator<T>, OutOfBounds<T>, RandomAccess<T>, RealOutOfBounds<T>
All Known Implementing Classes:
AbstractArrayCursor, AbstractArrayLocalizingCursor, AbstractConvertedCursor, AbstractConvertedRandomAccess, AbstractCursor, AbstractCursorInt, AbstractLocalizable, AbstractLocalizableInt, AbstractLocalizingCursor, AbstractLocalizingCursorInt, AbstractLongListImg.LongListCursor, AbstractLongListImg.LongListLocalizingCursor, AbstractLongListImg.LongListRandomAccess, AbstractOutOfBoundsMirror, AbstractOutOfBoundsValue, AbstractProjector2D, AbstractWrappedLocalizable, AbstractWrappedPositionableLocalizable, ArrayCursor, ArrayImgXYByteProjector, ArrayImgXYShortProjector, ArrayLocalizingCursor, ArrayLocalizingSpliterator, ArrayLocalizingSubIntervalCursor, ArrayRandomAccess, ArraySpliterator, ArraySubIntervalCursor, BiConvertedCursor, BiConvertedRandomAccess, BundleView.BundleRandomAccess, CellCursor, CellGrid.CellIntervalsRA, CellLocalizingCursor, CellRandomAccess, CellSpliterator, CompositeView.CompositeRandomAccess, CompositeXYProjector, CompositeXYRandomAccessibleProjector, ConvertedCursor, ConvertedRandomAccess, CursorSpliterator, FullSourceMapMixedRandomAccess, FullSourceMapSlicingRandomAccess, FunctionRandomAccessible.FunctionRandomAccess, FunctionView.FunctionRandomAccess, Grid.CellIntervalsRA, HyperSlice.HyperSliceRandomAccess, HyperSlicesView.HyperSlicesViewRandomAccess, InflateView.InflateRandomAccess, InterleaveView.InterleaveRandomAccess, IntervalIterator, IterableIntervalProjector2D, ListCursor, ListLocalizingCursor, ListRandomAccess, Localizables.LocationRandomAccess, LocalizableSamplerWrapper, LocalizingIntervalIterator, LocalizingZeroMinIntervalIterator, MixedRandomAccess, NtreeCursor, NtreeRandomAccess, OffsetableIntervalIterator, OffsetableLocalizingIntervalIterator, OutOfBoundsBorder, OutOfBoundsConstantValue, OutOfBoundsMirrorDoubleBoundary, OutOfBoundsMirrorExpWindowing, OutOfBoundsMirrorSingleBoundary, OutOfBoundsPeriodic, OutOfBoundsRandomValue, PlanarCursor, PlanarCursor1D, PlanarCursor2D, PlanarImgXYByteProjector, PlanarImgXYShortProjector, PlanarLocalizingCursor, PlanarLocalizingCursor1D, PlanarLocalizingCursor2D, PlanarPlaneSubsetCursor, PlanarPlaneSubsetLocalizingCursor, PlanarRandomAccess, PlanarRandomAccess1D, PlanarSpliterator, Point, PointSample, PointSampleList.PointSampleListCursor, PositionRandomAccessible.PositionRandomAccess, RandomAccessibleIntervalCursor, RandomAccessibleOnRealRandomAccessible.RandomAccessOnRealRandomAccessible, RandomAccessiblePair.RandomAccess, RandomAccessibleProjector2D, SamplingProjector2D, SlicingCursor, SlicingRandomAccess, StackView.DefaultRA, StackView.MoveAllSlicesRA, SubsampleView.SubsampleRandomAccess, TransformRandomAccess, TranslationRandomAccess, Volatile2DRandomAccessibleProjector, WriteConvertedCursor, WriteConvertedRandomAccess, ZeroMinIntervalIterator

public interface Localizable extends RealLocalizable
The Localizable interface can localize itself in an n-dimensional discrete space. Not only Cursors can use this interface, it might be used by much more classes as RandomAccesss can take any Localizable as input for where they should move to.
  • Method Details

    • localize

      default void localize(int[] position)
      Write the current position into the passed array.
      Parameters:
      position - receives current position, length must be ≥ EuclideanSpace.numDimensions()
    • localize

      default void localize(long[] position)
      Write the current position into the passed array.
      Parameters:
      position - receives current position, length must be ≥ EuclideanSpace.numDimensions()
    • localize

      default void localize(Positionable position)
      Write the current position into the passed Positionable. Note for developers: This default implementation forwards to Positionable.setPosition(Localizable), so don't do the same there.
      Parameters:
      position - receives current position, EuclideanSpace.numDimensions() must be ≥ EuclideanSpace.numDimensions()
    • localize

      default void localize(RealPositionable position)
      Description copied from interface: RealLocalizable
      Write the current position into the passed Positionable. Note for developers: This default implementation forwards to RealPositionable.setPosition(RealLocalizable), so don't do the same there.
      Specified by:
      localize in interface RealLocalizable
      Parameters:
      position - receives current position EuclideanSpace.numDimensions() must be ≥ EuclideanSpace.numDimensions()
    • getIntPosition

      default int getIntPosition(int d)
      Return the current position in a given dimension.
      Parameters:
      d - dimension
      Returns:
      dimension of current position
    • positionAsLongArray

      default long[] positionAsLongArray()
      Allocate and return a long array containing the localizable's position. Please note that his method allocates a new array each time which introduces notable overhead in both compute and memory. If you query it frequently, you should allocate a dedicated array first and reuse it with localize(long[]).
      Returns:
      the position
    • positionAsPoint

      default Point positionAsPoint()
      Allocate and return a Point containing the localizable's position. Please note that his method allocates a new Point each time which introduces notable overhead in both compute and memory. If you query it frequently, you should allocate a dedicated Point first and reuse it with localize(Positionable).
      Returns:
      the position
    • getLongPosition

      long getLongPosition(int d)
      Return the current position in a given dimension.
      Parameters:
      d - dimension
      Returns:
      dimension of current position
    • getFloatPosition

      default float getFloatPosition(int d)
      Description copied from interface: RealLocalizable
      Return the current position in a given dimension.
      Specified by:
      getFloatPosition in interface RealLocalizable
      Parameters:
      d - dimension
      Returns:
      dimension of current position
    • getDoublePosition

      default double getDoublePosition(int d)
      Description copied from interface: RealLocalizable
      Return the current position in a given dimension.
      Specified by:
      getDoublePosition in interface RealLocalizable
      Parameters:
      d - dimension
      Returns:
      dimension of current position