Class BiConvertedRealCursor<A,​B,​C>

    • Field Detail

      • converterSupplier

        protected final java.util.function.Supplier<BiConverter<? super A,​? super B,​? super C>> converterSupplier
      • converter

        protected final BiConverter<? super A,​? super B,​? super C> converter
      • convertedSupplier

        protected final java.util.function.Supplier<? extends C> convertedSupplier
      • converted

        protected final C converted
    • Constructor Detail

      • BiConvertedRealCursor

        public BiConvertedRealCursor​(RealCursor<A> sourceA,
                                     RealCursor<B> sourceB,
                                     java.util.function.Supplier<BiConverter<? super A,​? super B,​? super C>> converterSupplier,
                                     java.util.function.Supplier<? extends C> convertedSupplier)
        Creates a copy of c for conversion that can be accessed through get().
        Parameters:
        sourceA -
        sourceB -
        converterSupplier -
        convertedSupplier -
      • BiConvertedRealCursor

        public BiConvertedRealCursor​(RealCursor<A> sourceA,
                                     RealCursor<B> sourceB,
                                     BiConverter<? super A,​? super B,​? super C> converter,
                                     java.util.function.Supplier<? extends C> convertedSupplier)
        Creates a copy of c for conversion that can be accessed through get().
        Parameters:
        sourceA -
        sourceB -
        converter -
        convertedSupplier -
    • Method Detail

      • get

        public C 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.
      • getType

        public C 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.

        Returns:
        an instance of T
      • jumpFwd

        public void jumpFwd​(long steps)
        Description copied from interface: Iterator
        Move steps × forward.

        Highly recommended to override this with a more efficient version.

        Specified by:
        jumpFwd in interface Iterator
        Overrides:
        jumpFwd in class AbstractConvertedRealCursor<A,​C>
        Parameters:
        steps - number of steps to move forward
      • hasNext

        public boolean hasNext()
        The correct logic would be to return sourceA.hasNext() && sourceB.hasNext() but we test only sourceA for efficiency. Make sure that sourceA is the smaller IterableInterval.
        Specified by:
        hasNext in interface java.util.Iterator<A>
        Specified by:
        hasNext in interface Iterator
        Overrides:
        hasNext in class AbstractConvertedRealCursor<A,​C>
        Returns:
        true, if there is another step forward is possible, otherwise false