T
- is the actual number type.StreamIterator<T>
, Iterator<T>
public class StatisticsIterator<T extends Number & Comparable<T>> extends Object implements StreamIterator<T>
RunningStatistics
when
iterating.Constructor | Description |
---|---|
StatisticsIterator(StreamIterator<T> iterator) |
Modifier and Type | Method | Description |
---|---|---|
long |
getCount() |
|
double |
getMax() |
|
double |
getMean() |
|
double |
getMin() |
|
double |
getS() |
|
double |
getSigma() |
|
boolean |
hasNext() |
|
T |
next() |
This method overwrites
Iterator.next() with a one change: The
resulting element is never null . |
T |
peek() |
This method returns the next element which will be returned by next(),
without moving forward.
|
forEachRemaining, remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
empty, filter, flatMap, map, of, spliterator, stream
public StatisticsIterator(StreamIterator<T> iterator)
public boolean hasNext()
public T next() throws NoSuchElementException
StreamIterator
Iterator.next()
with a one change: The
resulting element is never null
.next
in interface Iterator<T extends Number & Comparable<T>>
next
in interface StreamIterator<T extends Number & Comparable<T>>
NoSuchElementException
is thrown.
Iterator.hasNext()
will returned false
in this case and
should be asked for the presence of more elements in advance. The
result is never null
.NoSuchElementException
- is thrown in case the stream has reached its
end.public T peek() throws NoSuchElementException
StreamIterator
peek
in interface StreamIterator<T extends Number & Comparable<T>>
NoSuchElementException
is thrown.
Iterator.hasNext()
will returned false
in this case and
should be asked for the presence of more elements in advance. The
result is never null
.NoSuchElementException
- is thrown in case the stream has reached its
end.public long getCount()
public double getMin()
public double getMax()
public double getMean()
public double getSigma()
public double getS()
Copyright © 2017–2018 PureSol Technologies. All rights reserved.