Interface IterableRealInterval<T>
- Type Parameters:
T-
- All Superinterfaces:
EuclideanSpace, Iterable<T>, RealInterval, Typed<T>
- All Known Subinterfaces:
Img<T>, IterableInterval<T>, NativeImg<T,A>, RandomAccessibleInterval<T>, SubIntervalIterable<T>
- All Known Implementing Classes:
AbstractCellImg, AbstractConvertedIterableInterval, AbstractConvertedIterableRandomAccessibleInterval, AbstractConvertedIterableRealInterval, AbstractConvertedRandomAccessibleInterval, AbstractImg, AbstractListImg, AbstractLongListImg, AbstractNativeImg, ARGBScreenImage, ArrayImg, ArrayImgAWTScreenImage, BiConvertedIterableInterval, BiConvertedIterableRealInterval, BiConvertedRandomAccessibleInterval, ByteAWTScreenImage, CellGrid.CellIntervals, CellImg, CompositeIntervalView, ConvertedIterableInterval, ConvertedIterableRealInterval, ConvertedRandomAccessibleInterval, DiscreteFrequencyDistribution, DoubleAWTScreenImage, FloatAWTScreenImage, Grid.CellIntervals, Histogram1d, HistogramNd, ImgView, IntAWTScreenImage, IntervalView, IterableRandomAccessibleInterval, IterableTransformBuilder.IterableIntervalView, IterableTransformBuilder.Slice, IterableTransformBuilder.SubInterval, KDTree, LazyCellImg, LazyCellImg.LazyCells, ListImg, NtreeImg, PlanarImg, PointSampleList, RealPointSampleList, ShortAWTScreenImage, StackView, SubsampleIntervalView, UnsignedByteAWTScreenImage, UnsignedIntAWTScreenImage, UnsignedShortAWTScreenImage, WriteConvertedIterableInterval, WriteConvertedIterableRandomAccessibleInterval, WriteConvertedIterableRealInterval, WriteConvertedRandomAccessibleInterval
f:Rn∈[0,s]→T
A function over real space and a finite set of elements in the target domain
T. All target elements T can be accessed through Iterators.
There is an iterator that tracks its source location at each move and one
that calculates it on request only. Depending on the frequency of requesting
the source location, either of them is optimal in terms of speed. Iteration
order is constant for an individual IterableRealInterval but not
further specified.
-
Method Summary
Modifier and TypeMethodDescriptioncursor()Returns aRealCursorthat iterates with optimal speed without calculating the location at each iteration step.default TGet the first element of thisIterableRealInterval.default TgetType()Get an instance ofT.Returns the iteration order of thisIterableRealInterval.iterator()Returns aRealLocalizableIteratorthat calculates its location at each iteration step.default RealLocalizableSpliterator<T> Creates aRealLocalizableSpliteratorover the elements of thisIterableRealInterval.Returns a parallelStreamover the elements of thisIterableRealInterval.longsize()Returns the number of elements in thisFunction.default RealLocalizableSpliterator<T> Creates aRealLocalizableSpliteratorover the elements of thisIterableRealInterval.stream()Returns a sequentialStreamover the elements of thisIterableRealInterval.Methods inherited from interface EuclideanSpace
numDimensionsMethods inherited from interface RealInterval
maxAsDoubleArray, maxAsRealPoint, minAsDoubleArray, minAsRealPoint, realMax, realMax, realMax, realMin, realMin, realMin
-
Method Details
-
cursor
RealCursor<T> cursor()Returns a
RealCursorthat iterates with optimal speed without calculating the location at each iteration step. Localization is performed on demand.Use this where localization is required rarely/ not for each iteration.
- Returns:
- fast iterating iterator
-
localizingCursor
RealCursor<T> localizingCursor()Returns a
RealLocalizableIteratorthat calculates its location at each iteration step. That is, localization is performed with optimal speed.Use this where localization is required often/ for each iteration.
- Returns:
- fast localizing iterator
-
size
-
firstElement
Get the first element of thisIterableRealInterval. This is a shortcut forcursor().next().This can be used to create a new variable of type T using
firstElement().createVariable(), which is useful in generic methods to store temporary results, e.g., a running sum over pixels in theIterableRealInterval.- Returns:
- the first element in iteration order.
-
getType
Get an instance ofT.It should not be assumed that the returned
Tinstance is an independent copy. In particular, repeated calls togetType()may return the same instance.The default implementation returns
firstElement(). Derived classes may choose different implementations for improved performance. -
iterationOrder
Object iterationOrder()Returns the iteration order of thisIterableRealInterval. If the returned object equals (Object.equals(Object)) the iteration order of anotherIterableRealIntervalf then they can be copied by synchronous iteration. That is, having anIteratoron this and anotherIteratoron f, moving both in synchrony will point both of them to corresponding locations in their source domain. In other words, this and f have the same iteration order and means and the same number of elements.- Returns:
- the iteration order of this
IterableRealInterval. - See Also:
-
iterator
-
stream
Returns a sequentialStreamover the elements of thisIterableRealInterval.Note that the returned
Streamgives access only to the values of the elements, not their locations. To obtain aStreamthat includes locations, seeStreams.localizable(IterableRealInterval).The default implementation creates a sequential
Streamfrom the interval'sspliterator(). -
parallelStream
Returns a parallelStreamover the elements of thisIterableRealInterval.Note that the returned
Streamgives access only to the values of the elements, not their locations. To obtain aStreamthat includes locations, seeStreams.localizable(IterableRealInterval).The default implementation creates a parallel
Streamfrom the interval'sspliterator(). -
spliterator
Creates aRealLocalizableSpliteratorover the elements of thisIterableRealInterval. The returnedSpliteratoriterates with optimal speed without calculating the location at each iteration step. Localization is performed on demand.The default implementation wraps a
RealCursoron the interval. The createdSpliteratorreportsSpliterator.SIZED,Spliterator.SUBSIZED,Spliterator.ORDEREDandSpliterator.NONNULL.- Specified by:
spliteratorin interfaceIterable<T>
-
localizingSpliterator
Creates aRealLocalizableSpliteratorover the elements of thisIterableRealInterval. The returnedSpliteratorcalculates its location at each iteration step. That is, localization is performed with optimal speed.The default implementation wraps a
localizingRealCursoron the interval. The createdSpliteratorreportsSpliterator.SIZED,Spliterator.SUBSIZED,Spliterator.ORDEREDandSpliterator.NONNULL.
-