Class RealCursorSpliterator<T>

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Spliterator

        java.util.Spliterator.OfDouble, java.util.Spliterator.OfInt, java.util.Spliterator.OfLong, java.util.Spliterator.OfPrimitive<T extends java.lang.Object,​T_CONS extends java.lang.Object,​T_SPLITR extends java.util.Spliterator.OfPrimitive<T,​T_CONS,​T_SPLITR>>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int characteristics
      Characteristics always include SIZED | SUBSIZED.
      private RealCursor<T> cursor
      The underlying cursor, positioned such that cursor.next() yields the element at index.
      private long fence
      One past last index
      private long index
      The current index, modified on advance/split.
      • Fields inherited from interface java.util.Spliterator

        CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED
    • Constructor Summary

      Constructors 
      Constructor Description
      RealCursorSpliterator​(RealCursor<T> cursor, long origin, long fence, int additionalCharacteristics)
      Creates a spliterator covering the given range.
    • Field Detail

      • cursor

        private final RealCursor<T> cursor
        The underlying cursor, positioned such that cursor.next() yields the element at index.
      • index

        private long index
        The current index, modified on advance/split.
      • fence

        private final long fence
        One past last index
      • characteristics

        private final int characteristics
        Characteristics always include SIZED | SUBSIZED.
    • Constructor Detail

      • RealCursorSpliterator

        public RealCursorSpliterator​(RealCursor<T> cursor,
                                     long origin,
                                     long fence,
                                     int additionalCharacteristics)
        Creates a spliterator covering the given range.
        Parameters:
        cursor - provides elements, starting with the element at origin, on cursor.next()
        origin - the least index (inclusive) to cover
        fence - one past the greatest index to cover
        additionalCharacteristics - additional characteristics besides SIZED | SUBSIZED
    • Method Detail

      • tryAdvance

        public boolean tryAdvance​(java.util.function.Consumer<? super T> action)
        Specified by:
        tryAdvance in interface java.util.Spliterator<T>
      • estimateSize

        public long estimateSize()
        Specified by:
        estimateSize in interface java.util.Spliterator<T>
      • characteristics

        public int characteristics()
        Specified by:
        characteristics in interface java.util.Spliterator<T>
      • get

        public T get()
        Description copied from interface: Sampler
        Access the actual T instance providing access to a pixel, sub-pixel or integral region value the Sampler points at.
        Specified by:
        get in interface Sampler<T>
      • getType

        public T getType()
        Description copied from interface: Typed
        Get an instance of T.

        It should not be assumed that the returned T instance is an independent copy. In particular, repeated calls to getType() may return the same instance.

        Specified by:
        getType in interface Sampler<T>
        Specified by:
        getType in interface Typed<T>
        Returns:
        an instance of T
      • copy

        public RealCursorSpliterator<T> copy()
        Specified by:
        copy in interface RealLocalizableSpliterator<T>
        Specified by:
        copy in interface Sampler<T>
        Returns:
        - A new Sampler in the same state accessing the same values. It does NOT copy T, just the state of the Sampler. Otherwise use T.copy() if available. Sampler.copy().get() == Sampler.get(), i.e. both hold the same value, not necessarily the same instance (this is the case for an ArrayCursor for example)
      • positionAsDoubleArray

        public double[] positionAsDoubleArray()
        Description copied from interface: RealLocalizable
        Allocate and return a double array with the 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 RealLocalizable.localize(double[]).
        Specified by:
        positionAsDoubleArray in interface RealLocalizable
        Returns:
        the position
      • getFloatPosition

        public 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

        public 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