H
- Geometric boundary typeB
- Boundary source typepublic interface BoundaryReadHandler<H extends HyperplaneConvexSubset<?>,B extends BoundarySource<H>>
BoundaryIOManager
.
Implementation note: implementations of this interface must be thread-safe.
Modifier and Type | Method and Description |
---|---|
Stream<H> |
boundaries(GeometryInput in,
Precision.DoubleEquivalence precision)
Return a
Stream that can be used to access all boundary information from the given input,
which is expected to contain data in the format supported by this handler. |
GeometryFormat |
getFormat()
Get the
data format supported by this handler. |
B |
read(GeometryInput input,
Precision.DoubleEquivalence precision)
Return an object containing all boundaries read from
input using the handler's
supported data format. |
GeometryFormat getFormat()
data format
supported by this handler.B read(GeometryInput input, Precision.DoubleEquivalence precision)
input
using the handler's
supported data format.input
- input to read fromprecision
- precision context used for floating point comparisonsinput
IllegalArgumentException
- if mathematically invalid data is encounteredIllegalStateException
- if a data format error occursUncheckedIOException
- if an I/O error occursStream<H> boundaries(GeometryInput in, Precision.DoubleEquivalence precision)
Stream
that can be used to access all boundary information from the given input,
which is expected to contain data in the format supported by this handler. Unlike the
read
method, this method does not require
that all input be read immediately and stored in memory (although implementations of this interface are
still free to do so). Callers may therefore prefer to use this method in cases where memory usage is a
concern or transformations and/or filters must be applied to the boundaries before use.
Implementing class will usually keep the source input stream open during stream iteration. Callers should therefore use the returned stream in a try-with-resources statement to ensure that all resources are properly released. Ex:
try (Stream<H> stream = handler.boundaries(in, precision)) { // access stream content }
The following exceptions may be thrown during stream iteration:
IllegalArgumentException
if mathematically invalid data is encounteredIllegalStateException
if a data format error occursUncheckedIOException
if an I/O error occursin
- input to read fromprecision
- precision context used for floating point comparisonsIllegalStateException
- if a data format error occurs during stream creationUncheckedIOException
- if an I/O error occurs during stream creationCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.