Class CommentsContainer

java.lang.Object
org.orekit.files.ccsds.section.CommentsContainer
All Implemented Interfaces:
Section
Direct Known Subclasses:
AdditionalCovarianceMetadata, AemData, AngularVelocity, ApmQuaternion, AttitudeCovarianceHistoryMetadata, AttitudeDetermination, AttitudeDeterminationSensor, AttitudeManeuver, AttitudePhysicalProperties, AttitudeStateHistoryMetadata, CartesianCovariance, CommonPhysicalProperties, Euler, Header, Inertia, KeplerianElements, Maneuver, Maneuver, Metadata, ObservationsBlock, ODParameters, OemData, OmmTle, OrbitCovarianceHistoryMetadata, OrbitDetermination, OrbitManeuverHistoryMetadata, Perturbations, RTNCovariance, SigmaEigenvectorsCovariance, SpacecraftParameters, SpinStabilized, StateVector, StateVector, TrajectoryStateHistoryMetadata, UserDefined, XYZCovariance

public class CommentsContainer extends Object implements Section
Container for comments in various CCSDS messages.

CCSDS files accept comments only at the beginning of sections. Once header/metadata/data content has started, comments in the corresponding section are refused.

Since:
11.0
Author:
Luc Maisonobe
  • Constructor Details

    • CommentsContainer

      public CommentsContainer()
      Create a new meta-data.
  • Method Details

    • checkNotNegative

      public void checkNotNegative(int field, String key)
      Complain if a field is negative.
      Parameters:
      field - field to check
      key - key associated with the field
    • checkNotNaN

      public void checkNotNaN(double field, String key)
      Complain if a field is NaN.
      Parameters:
      field - field to check
      key - key associated with the field
    • checkNotNull

      public void checkNotNull(Object field, String key)
      Complain if a field is null.
      Parameters:
      field - field to check
      key - key associated with the field
    • checkAllowed

      public void checkAllowed(double version, Object field, String key, double minVersion, double maxVersion)
      Complain if a key is not allowed.
      Parameters:
      version - format version
      field - field to check
      key - key associated with the field
      minVersion - version at which key started to be allowed
      maxVersion - version at which key started to be forbidden
    • validate

      public void validate(double version)
      Check is all mandatory entries have been initialized.

      This method should throw an exception if some mandatory entries are missing or not compatible with version number.

      Specified by:
      validate in interface Section
      Parameters:
      version - format version
    • getComments

      public List<String> getComments()
      Get the comments.
      Returns:
      comments
    • setComments

      public void setComments(List<String> comments)
      Set the comments. This removes all previous comments and replaces them with the new ones.
      Parameters:
      comments - List with new comments
    • acceptComments

      public boolean acceptComments()
      Check if container is still accepting comments.

      A container that still accept comments does not contain any other data.

      Returns:
      true if container is still accepting comments
    • refuseFurtherComments

      public void refuseFurtherComments()
      Set flag to refuse further comments.
    • addComment

      public boolean addComment(String comment)
      Add comment.

      Comments are accepted only at start. Once other content is stored in the same section, comments are refused.

      Parameters:
      comment - comment line
      Returns:
      true if comment was accepted