public interface ObservationStream extends ThrowingIterator<OmObservation,OwsExceptionReport>, AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
default void |
close() |
default <T extends Collection<OmObservation>> |
collect(Supplier<T> supplier) |
static ObservationStream |
empty()
Creates an empty observation stream.
|
default ObservationStream |
filter(Predicate<OmObservation> predicate)
Creates a new observation stream that filters the observatons from the
original stream using the supplied predicate.
|
default Optional<OmObservation> |
findAny()
As this stream is always serial this is the same as
findFirst()
. |
default Optional<OmObservation> |
findFirst()
Gets the next value that is in the stream.
|
default ObservationStream |
flatMap(ThrowingFunction<OmObservation,ObservationStream,OwsExceptionReport> mapper)
Creates a new observation stream from a mapping function that produces a
stream for every observation in this stream.
|
default ObservationStream |
map(ThrowingUnaryOperator<OmObservation,OwsExceptionReport> operator)
Produces a observation new stream from a mapping function that produces a
new observation for every observation in this stream.
|
default ObservationStream |
merge()
Creates a new stream out of this stream in which observations with the
same observation constellation are merged.
|
default ObservationStream |
merge(ObservationMergeIndicator indicator)
Creates a new stream out of this stream in which observations with the
same observation constellation are merged.
|
default ObservationStream |
modify(ThrowingConsumer<OmObservation,OwsExceptionReport> consumer)
Creates a new observation stream from an consumer that consumes every
observation before it is emitted by the stream.
|
static ObservationStream |
of(Iterable<OmObservation> observations)
Creates a new observation stream from the supplied iterable.
|
static ObservationStream |
of(Iterator<OmObservation> observations)
Creates a new observation stream from the supplied iterator.
|
static ObservationStream |
of(OmObservation observation)
Creates a new observation stream from the supplied observation.
|
default Stream<OmObservation> |
toStream()
Creates a new stream of this observation stream.
|
forEachRemaining, hasNext, next, removedefault void close()
close in interface AutoCloseabledefault <T extends Collection<OmObservation>> T collect(Supplier<T> supplier) throws OwsExceptionReport
OwsExceptionReportdefault Optional<OmObservation> findFirst() throws OwsExceptionReport
OwsExceptionReport - if an error occurs during observation retrievaldefault Stream<OmObservation> toStream()
RuntimeExceptions.default Optional<OmObservation> findAny() throws OwsExceptionReport
findFirst()
.OwsExceptionReport - if an error occurs during observation retrieval@CheckReturnValue default ObservationStream modify(ThrowingConsumer<OmObservation,OwsExceptionReport> consumer)
consumer - the consumer@CheckReturnValue default ObservationStream flatMap(ThrowingFunction<OmObservation,ObservationStream,OwsExceptionReport> mapper)
mapper - the mapping function@CheckReturnValue default ObservationStream map(ThrowingUnaryOperator<OmObservation,OwsExceptionReport> operator)
operator - the mapping function@CheckReturnValue default ObservationStream filter(Predicate<OmObservation> predicate)
predicate - the filter@CheckReturnValue default ObservationStream merge() throws OwsExceptionReport
OwsExceptionReport - if an error occurs during observation retrievalOmObservation.checkForMerge(org.n52.shetland.ogc.om.OmObservation),
OmObservation.mergeWithObservation(org.n52.shetland.ogc.om.OmObservation)@CheckReturnValue default ObservationStream merge(ObservationMergeIndicator indicator) throws OwsExceptionReport
indicator - OwsExceptionReport - if an error occurs during observation retrievalOmObservation.checkForMerge(org.n52.shetland.ogc.om.OmObservation),
OmObservation.mergeWithObservation(org.n52.shetland.ogc.om.OmObservation)static ObservationStream empty()
static ObservationStream of(Iterator<OmObservation> observations)
observations - the observationsstatic ObservationStream of(Iterable<OmObservation> observations)
observations - the observationsstatic ObservationStream of(OmObservation observation)
observation - the observationCopyright © 2015–2021 52North Initiative for Geospatial Open Source Software GmbH. All rights reserved.