Class AbstractTextBoundaryWriteHandler3D
java.lang.Object
org.apache.commons.geometry.io.euclidean.threed.AbstractBoundaryWriteHandler3D
org.apache.commons.geometry.io.euclidean.threed.txt.AbstractTextBoundaryWriteHandler3D
- All Implemented Interfaces:
BoundaryWriteHandler<PlaneConvexSubset, BoundarySource3D>, BoundaryWriteHandler3D
- Direct Known Subclasses:
CsvBoundaryWriteHandler3D, TextBoundaryWriteHandler3D
Abstract based class for write handlers that output text formats produced
by
TextFacetDefinitionWriter.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringThe default line separator value.private CharsetDefault charset used for text output.private DoubleFunction<String> Double format function.private StringLine separator string. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the text output default charset, used if the output does not specify a charset.Get the double format function used to convert double values to strings.protected TextFacetDefinitionWriterGet a configuredTextFacetDefinitionWriterfor writing output.Get the line separator.voidsetDefaultCharset(Charset defaultCharset) Set the text output default charset, used if the output does not specify a charset.voidsetDoubleFormat(DoubleFunction<String> doubleFormat) Set the double format function used to convert double values to strings.voidsetLineSeparator(String lineSeparator) Set the line separator.voidwrite(Stream<? extends PlaneConvexSubset> boundaries, GeometryOutput out) Write all boundaries in the stream to the given output using the data format supported by this instance.voidwriteFacets(Stream<? extends FacetDefinition> facets, GeometryOutput out) Write allfacetsin the stream to the output using the data format supported by this instance.Methods inherited from class AbstractBoundaryWriteHandler3D
write, writeFacetsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BoundaryWriteHandler
getFormat
-
Field Details
-
DEFAULT_LINE_SEPARATOR
-
defaultCharset
Default charset used for text output. -
lineSeparator
Line separator string. -
doubleFormat
Double format function.
-
-
Constructor Details
-
AbstractTextBoundaryWriteHandler3D
public AbstractTextBoundaryWriteHandler3D()
-
-
Method Details
-
getDefaultCharset
Get the text output default charset, used if the output does not specify a charset.- Returns:
- text output default charset
-
setDefaultCharset
Set the text output default charset, used if the output does not specify a charset.- Parameters:
defaultCharset- text output default charset
-
getLineSeparator
-
setLineSeparator
Set the line separator.- Parameters:
lineSeparator- the line separator to use
-
getDoubleFormat
Get the double format function used to convert double values to strings.- Returns:
- double format function
-
setDoubleFormat
Set the double format function used to convert double values to strings. The given function must be thread-safe if this handler is to be used in a multi-threaded context.- Parameters:
doubleFormat- double format function
-
write
Write all boundaries in the stream to the given output using the data format supported by this instance. The stream passed as an argument is not closed, meaning that callers are responsible for closing the stream if necessary (for example, if the stream fetches data from the file system).- Parameters:
boundaries- stream containing boundaries to writeout- output to write to
-
writeFacets
Write allfacetsin the stream to the output using the data format supported by this instance. The stream passed as an argument is not closed, meaning that callers are responsible for closing the stream if necessary (for example, if the stream fetches data from the file system).- Parameters:
facets- stream containing facets to writeout- output to write to
-
getFacetDefinitionWriter
Get a configuredTextFacetDefinitionWriterfor writing output.- Parameters:
out- output stream to write to- Returns:
- a new, configured text format writer
- Throws:
UncheckedIOException- if an I/O error occurs
-