AcmDataSubStructureKey.java

  1. /* Copyright 2022-2025 Luc Maisonobe
  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.adm.acm;

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

  20. /** Keywords for ACM data sub-structure.
  21.  * @author Luc Maisonobe
  22.  * @since 12.0
  23.  */
  24. public enum AcmDataSubStructureKey {

  25.     /** Attitude state time history section. */
  26.     ATT((token, parser) -> parser.manageAttitudeStateSection(token.getType() == TokenType.START)),

  27.     /** Trajectory state time history section. */
  28.     att((token, parser) -> parser.manageAttitudeStateSection(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.     /** Attitude determination section. */
  42.     AD((token, parser) -> parser.manageAttitudeDeterminationSection(token.getType() == TokenType.START)),

  43.     /** Orbit determination section. */
  44.     ad((token, parser) -> parser.manageAttitudeDeterminationSection(token.getType() == TokenType.START)),

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

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

  49.     /** Processing method. */
  50.     private final transient TokenProcessor processor;

  51.     /** Simple constructor.
  52.      * @param processor processing method
  53.      */
  54.     AcmDataSubStructureKey(final TokenProcessor processor) {
  55.         this.processor = processor;
  56.     }

  57.     /** Process one token.
  58.      * @param token token to process
  59.      * @param parser ACM file parser
  60.      * @return true of token was accepted
  61.      */
  62.     public boolean process(final ParseToken token, final AcmParser parser) {
  63.         return processor.process(token, parser);
  64.     }

  65.     /** Interface for processing one token. */
  66.     interface TokenProcessor {
  67.         /** Process one token.
  68.          * @param token token to process
  69.          * @param parser ACM file parser
  70.          * @return true of token was accepted
  71.          */
  72.         boolean process(ParseToken token, AcmParser parser);
  73.     }

  74. }