1   /* Copyright 2002-2021 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  
18  package org.orekit.files.ccsds.ndm.odm.omm;
19  
20  import java.util.regex.Pattern;
21  
22  import org.orekit.files.ccsds.ndm.odm.CommonMetadata;
23  
24  public class OmmMetadata extends CommonMetadata {
25  
26      /** Constant for SGP/SGP4 mean elements theory. */
27      public static final String SGP_SGP4_THEORY = "SGP/SGP4";
28  
29      /** Constant for DSST mean elements theory. */
30      public static final String DSST_THEORY = "DSST";
31  
32      /** Pattern for SGP or SDP theory. */
33      private static final Pattern SGP_SDP_PATTERN = Pattern.compile(".*S[GD]P.*");
34  
35      /** Description of the Mean Element Theory. Indicates the proper method to employ
36       * to propagate the state. */
37      private String meanElementTheory;
38  
39      /** Check if mean element theory in SGP or SDP.
40       * @return true if mean element theory in SGP or SDP
41       */
42      public boolean theoryIsSgpSdp() {
43          return SGP_SDP_PATTERN.matcher(meanElementTheory).matches();
44      }
45  
46      /** Get the description of the Mean Element Theory.
47       * @return the mean element theory
48       */
49      public String getMeanElementTheory() {
50          return meanElementTheory;
51      }
52  
53      /** Set the description of the Mean Element Theory.
54       * @param meanElementTheory the mean element theory to be set
55       */
56      public void setMeanElementTheory(final String meanElementTheory) {
57          refuseFurtherComments();
58          this.meanElementTheory = meanElementTheory;
59      }
60  
61  }