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
19 import org.orekit.frames.EopHistoryLoader.Parser;
20 import org.orekit.time.TimeScale;
21 import org.orekit.utils.IERSConventions;
22 import org.orekit.utils.IERSConventions.NutationCorrectionConverter;
23
24 /**
25 * Abstract class that holds common data used by several implementations of {@link
26 * Parser}.
27 *
28 * @author Evan Ward
29 * @since 10.1
30 */
31 abstract class AbstractEopParser implements Parser {
32
33 /** Converter for nutation corrections. */
34 private final IERSConventions.NutationCorrectionConverter converter;
35 /** Configuration for ITRF versions. */
36 private final ItrfVersionProvider itrfVersionProvider;
37 /** UTC time scale. */
38 private final TimeScale utc;
39
40 /**
41 * Simple constructor.
42 *
43 * @param converter converter to use
44 * @param itrfVersionProvider to use for determining the ITRF version of the EOP.
45 * @param utc time scale for parsing dates.
46 */
47 protected AbstractEopParser(final NutationCorrectionConverter converter,
48 final ItrfVersionProvider itrfVersionProvider,
49 final TimeScale utc) {
50 this.converter = converter;
51 this.itrfVersionProvider = itrfVersionProvider;
52 this.utc = utc;
53 }
54
55 /**
56 * Get the nutation converter.
57 *
58 * @return the nutation converter.
59 */
60 protected NutationCorrectionConverter getConverter() {
61 return converter;
62 }
63
64 /**
65 * Get the ITRF version loader.
66 *
67 * @return ITRF version loader.
68 */
69 protected ItrfVersionProvider getItrfVersionProvider() {
70 return itrfVersionProvider;
71 }
72
73 /**
74 * Get the UTC time scale.
75 *
76 * @return UTC time scale.
77 */
78 protected TimeScale getUtc() {
79 return utc;
80 }
81
82 }