Package org.orekit.files.ccsds.section
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
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if container is still accepting comments.booleanaddComment(String comment) Add comment.voidcheckAllowed(double version, Object field, String key, double minVersion, double maxVersion) Complain if a key is not allowed.voidcheckNotNaN(double field, String key) Complain if a field is NaN.voidcheckNotNegative(int field, String key) Complain if a field is negative.voidcheckNotNull(Object field, String key) Complain if a field is null.Get the comments.voidSet flag to refuse further comments.voidsetComments(List<String> comments) Set the comments.voidvalidate(double version) Check is all mandatory entries have been initialized.
-
Constructor Details
-
CommentsContainer
public CommentsContainer()Create a new meta-data.
-
-
Method Details
-
checkNotNegative
Complain if a field is negative.- Parameters:
field- field to checkkey- key associated with the field
-
checkNotNaN
Complain if a field is NaN.- Parameters:
field- field to checkkey- key associated with the field
-
checkNotNull
Complain if a field is null.- Parameters:
field- field to checkkey- 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 versionfield- field to checkkey- key associated with the fieldminVersion- version at which key started to be allowedmaxVersion- 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.
-
getComments
Get the comments.- Returns:
- comments
-
setComments
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
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
-