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 Details

    • TWO_DIGITS_INTEGER

      public static final FastLongFormatter TWO_DIGITS_INTEGER
      Format for one 2 digits integer field.
    • PADDED_TWO_DIGITS_INTEGER

      public static final FastLongFormatter PADDED_TWO_DIGITS_INTEGER
      Format for one 2 digits integer field.
    • THREE_DIGITS_INTEGER

      public static final FastLongFormatter THREE_DIGITS_INTEGER
      Format for one 3 digits integer field.
    • FOUR_DIGITS_INTEGER

      public static final FastLongFormatter FOUR_DIGITS_INTEGER
      Format for one 4 digits integer field.
    • PADDED_FOUR_DIGITS_INTEGER

      public static final FastLongFormatter PADDED_FOUR_DIGITS_INTEGER
      Format for one 4 digits integer field.
    • SIX_DIGITS_INTEGER

      public static final FastLongFormatter SIX_DIGITS_INTEGER
      Format for one 6 digits integer field.
    • NINE_TWO_DIGITS_FLOAT

      public static final FastDoubleFormatter NINE_TWO_DIGITS_FLOAT
      Format for one 9.2 digits float field.
    • NINETEEN_SCIENTIFIC_FLOAT

      public static final FastDoubleFormatter NINETEEN_SCIENTIFIC_FLOAT
      Format for one 19 characters wide field in scientific notation.
  • Constructor Details

    • BaseRinexWriter

      protected BaseRinexWriter(Appendable output, String outputName)
      Simple constructor.
      Parameters:
      output - destination of generated output
      outputName - output name for error messages
  • Method Details

    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException
    • prepareComments

      public void prepareComments(List<RinexComment> comments)
      Prepare comments to be emitted at specified lines.
      Parameters:
      comments - comments to be emitted
    • writeHeader

      protected void writeHeader(T header, int labelIndex) throws IOException
      Write header.
      Parameters:
      header - header to write
      labelIndex - index of the label in header
      Throws:
      IOException - if an I/O error occurs.
    • getHeader

      protected T getHeader()
      Get the header.
      Returns:
      header
    • getColumn

      protected int getColumn()
      Get column number.
      Returns:
      column number
    • finishHeaderLine

      protected void finishHeaderLine(Label label) throws IOException
      Finish one header line.
      Parameters:
      label - line label
      Throws:
      IOException - if an I/O error occurs.
    • finishLine

      public void finishLine() throws IOException
      Finish one line.
      Throws:
      IOException - if an I/O error occurs.
    • writeHeaderLine

      protected void writeHeaderLine(String s, Label label) throws IOException
      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

      protected void writeProgramRunByDate(RinexBaseHeader header) throws IOException
      Write the PGM / RUN BY / DATE header line.
      Parameters:
      header - header to write
      Throws:
      IOException - if an I/O error occurs.
    • outputField

      public void outputField(char c, int next) throws IOException
      Output one single character field.
      Parameters:
      c - field value
      next - target column for next field
      Throws:
      IOException - if an I/O error occurs.
    • outputField

      public void outputField(FastLongFormatter formatter, int value, int next) throws IOException
      Output one integer field.
      Parameters:
      formatter - formatter to use
      value - field value
      next - target column for next field
      Throws:
      IOException - if an I/O error occurs.
    • outputField

      public void outputField(FastLongFormatter formatter, long value, int next) throws IOException
      Output one long integer field.
      Parameters:
      formatter - formatter to use
      value - field value
      next - target column for next field
      Throws:
      IOException - if an I/O error occurs.
    • outputField

      public void outputField(FastDoubleFormatter formatter, double value, int next) throws IOException
      Output one double field.
      Parameters:
      formatter - formatter to use
      value - field value
      next - target column for next field
      Throws:
      IOException - if an I/O error occurs.
    • outputField

      public void outputField(String field, int next, boolean leftJustified) throws IOException
      Output one field.
      Parameters:
      field - field to output
      next - target column for next field
      leftJustified - if true, field is left-justified
      Throws:
      IOException - if an I/O error occurs.