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
,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 Summary
Constructors Constructor Description CommentsContainer()
Create a new meta-data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptComments()
Check if container is still accepting comments.boolean
addComment(String comment)
Add comment.void
checkAllowed(double version, Object field, String key, double minVersion, double maxVersion)
Complain if a key is not allowed.void
checkNotNaN(double field, String key)
Complain if a field is NaN.void
checkNotNegative(int field, String key)
Complain if a field is negative.void
checkNotNull(Object field, String key)
Complain if a field is null.List<String>
getComments()
Get the comments.void
refuseFurtherComments()
Set flag to refuse further comments.void
setComments(List<String> comments)
Set the comments.void
validate(double version)
Check is all mandatory entries have been initialized.
-
-
-
Method Detail
-
checkNotNegative
public void checkNotNegative(int field, String key)
Complain if a field is negative.- Parameters:
field
- field to checkkey
- key associated with the field
-
checkNotNaN
public void checkNotNaN(double field, String key)
Complain if a field is NaN.- Parameters:
field
- field to checkkey
- key associated with the field
-
checkNotNull
public void checkNotNull(Object field, String key)
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.
-
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
-
-