AbstractEopParser.java

  1. /* Contributed in the public domain.
  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.frames;

  18. import org.orekit.frames.EopHistoryLoader.Parser;
  19. import org.orekit.time.TimeScale;
  20. import org.orekit.utils.IERSConventions;
  21. import org.orekit.utils.IERSConventions.NutationCorrectionConverter;

  22. /**
  23.  * Abstract class that holds common data used by several implementations of {@link
  24.  * Parser}.
  25.  *
  26.  * @author Evan Ward
  27.  * @since 10.1
  28.  */
  29. abstract class AbstractEopParser implements Parser {

  30.     /** Converter for nutation corrections. */
  31.     private final IERSConventions.NutationCorrectionConverter converter;
  32.     /** Configuration for ITRF versions. */
  33.     private final ItrfVersionProvider itrfVersionProvider;
  34.     /** UTC time scale. */
  35.     private final TimeScale utc;

  36.     /**
  37.      * Simple constructor.
  38.      *
  39.      * @param converter           converter to use
  40.      * @param itrfVersionProvider to use for determining the ITRF version of the EOP.
  41.      * @param utc                 time scale for parsing dates.
  42.      */
  43.     protected AbstractEopParser(final NutationCorrectionConverter converter,
  44.                                 final ItrfVersionProvider itrfVersionProvider,
  45.                                 final TimeScale utc) {
  46.         this.converter = converter;
  47.         this.itrfVersionProvider = itrfVersionProvider;
  48.         this.utc = utc;
  49.     }

  50.     /**
  51.      * Get the nutation converter.
  52.      *
  53.      * @return the nutation converter.
  54.      */
  55.     protected NutationCorrectionConverter getConverter() {
  56.         return converter;
  57.     }

  58.     /**
  59.      * Get the ITRF version loader.
  60.      *
  61.      * @return ITRF version loader.
  62.      */
  63.     protected ItrfVersionProvider getItrfVersionProvider() {
  64.         return itrfVersionProvider;
  65.     }

  66.     /**
  67.      * Get the UTC time scale.
  68.      *
  69.      * @return UTC time scale.
  70.      */
  71.     protected TimeScale getUtc() {
  72.         return utc;
  73.     }

  74. }