OcmDataSubStructureKey.java

  1. /* Copyright 2002-2025 CS GROUP
  2.  * Licensed to CS GROUP (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.files.ccsds.ndm.odm.ocm;

  18. import org.orekit.files.ccsds.utils.lexical.ParseToken;
  19. import org.orekit.files.ccsds.utils.lexical.TokenType;

  20. /** Keywords for OCM data sub-structure.
  21.  * @author Luc Maisonobe
  22.  * @since 11.0
  23.  */
  24. public enum OcmDataSubStructureKey {

  25.     /** Trajectory state time history section. */
  26.     TRAJ((token, parser) -> parser.manageTrajectoryStateSection(token.getType() == TokenType.START)),

  27.     /** Trajectory state time history section. */
  28.     traj((token, parser) -> parser.manageTrajectoryStateSection(token.getType() == TokenType.START)),

  29.     /** Physical properties section. */
  30.     PHYS((token, parser) -> parser.managePhysicalPropertiesSection(token.getType() == TokenType.START)),

  31.     /** Physical properties section. */
  32.     phys((token, parser) -> parser.managePhysicalPropertiesSection(token.getType() == TokenType.START)),

  33.     /** Covariance time history section. */
  34.     COV((token, parser) -> parser.manageCovarianceHistorySection(token.getType() == TokenType.START)),

  35.     /** Covariance time history section. */
  36.     cov((token, parser) -> parser.manageCovarianceHistorySection(token.getType() == TokenType.START)),

  37.     /** Maneuvers section. */
  38.     MAN((token, parser) -> parser.manageManeuversSection(token.getType() == TokenType.START)),

  39.     /** Maneuvers section. */
  40.     man((token, parser) -> parser.manageManeuversSection(token.getType() == TokenType.START)),

  41.     /** Perturbations parameters section. */
  42.     PERT((token, parser) -> parser.managePerturbationParametersSection(token.getType() == TokenType.START)),

  43.     /** Perturbations parameters section. */
  44.     pert((token, parser) -> parser.managePerturbationParametersSection(token.getType() == TokenType.START)),

  45.     /** Orbit determination section. */
  46.     OD((token, parser) -> parser.manageOrbitDeterminationSection(token.getType() == TokenType.START)),

  47.     /** Orbit determination section. */
  48.     od((token, parser) -> parser.manageOrbitDeterminationSection(token.getType() == TokenType.START)),

  49.     /** User-defined parameters section. */
  50.     USER((token, parser) -> parser.manageUserDefinedParametersSection(token.getType() == TokenType.START)),

  51.     /** User-defined parameters section. */
  52.     user((token, parser) -> parser.manageUserDefinedParametersSection(token.getType() == TokenType.START));

  53.     /** Processing method. */
  54.     private final transient TokenProcessor processor;

  55.     /** Simple constructor.
  56.      * @param processor processing method
  57.      */
  58.     OcmDataSubStructureKey(final TokenProcessor processor) {
  59.         this.processor = processor;
  60.     }

  61.     /** Process one token.
  62.      * @param token token to process
  63.      * @param parser OCM file parser
  64.      * @return true of token was accepted
  65.      */
  66.     public boolean process(final ParseToken token, final OcmParser parser) {
  67.         return processor.process(token, parser);
  68.     }

  69.     /** Interface for processing one token. */
  70.     interface TokenProcessor {
  71.         /** Process one token.
  72.          * @param token token to process
  73.          * @param parser OCM file parser
  74.          * @return true of token was accepted
  75.          */
  76.         boolean process(ParseToken token, OcmParser parser);
  77.     }

  78. }