Package org.orekit.files.rinex.utils
Class BaseRinexWriter<T extends RinexBaseHeader>
java.lang.Object
org.orekit.files.rinex.utils.BaseRinexWriter<T>
- Type Parameters:
T- type of the header
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
RinexClockWriter,RinexNavigationWriter,RinexObservationWriter
public abstract class BaseRinexWriter<T extends RinexBaseHeader>
extends Object
implements AutoCloseable
Base write for Rinex files.
- Since:
- 14.0
- Author:
- Luc Maisonobe
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FastLongFormatterFormat for one 4 digits integer field.static final FastDoubleFormatterFormat for one 9.2 digits float field.static final FastDoubleFormatterFormat for one 19 characters wide field in scientific notation.static final FastLongFormatterFormat for one 4 digits integer field.static final FastLongFormatterFormat for one 2 digits integer field.static final FastLongFormatterFormat for one 6 digits integer field.static final FastLongFormatterFormat for one 3 digits integer field.static final FastLongFormatterFormat for one 2 digits integer field. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseRinexWriter(Appendable output, String outputName) Simple constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCheck header has been written.voidclose()protected booleanexceedsHeaderLength(int tentative) Check if column exceeds header line length.protected voidfinishHeaderLine(Label label) Finish one header line.voidFinish one line.protected intGet column number.protected TGet the header.voidoutputField(char c, int next) Output one single character field.voidoutputField(String field, int next, boolean leftJustified) Output one field.voidoutputField(FastDoubleFormatter formatter, double value, int next) Output one double field.voidoutputField(FastLongFormatter formatter, int value, int next) Output one integer field.voidoutputField(FastLongFormatter formatter, long value, int next) Output one long integer field.voidprepareComments(List<RinexComment> comments) Prepare comments to be emitted at specified lines.protected voidwriteHeader(T header, int labelIndex) Write header.protected voidwriteHeaderLine(String s, Label label) Write one header string.protected voidwriteProgramRunByDate(RinexBaseHeader header) Write the PGM / RUN BY / DATE header line.
-
Field Details
-
TWO_DIGITS_INTEGER
Format for one 2 digits integer field. -
PADDED_TWO_DIGITS_INTEGER
Format for one 2 digits integer field. -
THREE_DIGITS_INTEGER
Format for one 3 digits integer field. -
FOUR_DIGITS_INTEGER
Format for one 4 digits integer field. -
PADDED_FOUR_DIGITS_INTEGER
Format for one 4 digits integer field. -
SIX_DIGITS_INTEGER
Format for one 6 digits integer field. -
NINE_TWO_DIGITS_FLOAT
Format for one 9.2 digits float field. -
NINETEEN_SCIENTIFIC_FLOAT
Format for one 19 characters wide field in scientific notation.
-
-
Constructor Details
-
BaseRinexWriter
Simple constructor.- Parameters:
output- destination of generated outputoutputName- output name for error messages
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
prepareComments
Prepare comments to be emitted at specified lines.- Parameters:
comments- comments to be emitted
-
writeHeader
Write header.- Parameters:
header- header to writelabelIndex- index of the label in header- Throws:
IOException- if an I/O error occurs.
-
getHeader
Get the header.- Returns:
- header
-
getColumn
protected int getColumn()Get column number.- Returns:
- column number
-
finishHeaderLine
Finish one header line.- Parameters:
label- line label- Throws:
IOException- if an I/O error occurs.
-
finishLine
Finish one line.- Throws:
IOException- if an I/O error occurs.
-
writeHeaderLine
Write one header string.- Parameters:
s- string data (may be null)label- line label- Throws:
IOException- if an I/O error occurs.
-
checkHeaderWritten
protected void checkHeaderWritten()Check header has been written. -
exceedsHeaderLength
protected boolean exceedsHeaderLength(int tentative) Check if column exceeds header line length.- Parameters:
tentative- tentative column number- Returns:
- true if tentative column number exceeds header line length
-
writeProgramRunByDate
Write the PGM / RUN BY / DATE header line.- Parameters:
header- header to write- Throws:
IOException- if an I/O error occurs.
-
outputField
Output one single character field.- Parameters:
c- field valuenext- target column for next field- Throws:
IOException- if an I/O error occurs.
-
outputField
Output one integer field.- Parameters:
formatter- formatter to usevalue- field valuenext- target column for next field- Throws:
IOException- if an I/O error occurs.
-
outputField
Output one long integer field.- Parameters:
formatter- formatter to usevalue- field valuenext- target column for next field- Throws:
IOException- if an I/O error occurs.
-
outputField
Output one double field.- Parameters:
formatter- formatter to usevalue- field valuenext- target column for next field- Throws:
IOException- if an I/O error occurs.
-
outputField
Output one field.- Parameters:
field- field to outputnext- target column for next fieldleftJustified- if true, field is left-justified- Throws:
IOException- if an I/O error occurs.
-