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.data;
18
19 import org.orekit.bodies.CelestialBodies;
20 import org.orekit.forces.gravity.potential.GravityFields;
21 import org.orekit.frames.Frames;
22 import org.orekit.models.earth.GeoMagneticFields;
23 import org.orekit.time.TimeScales;
24
25 /**
26 * A simple implementation of {@link DataContext} that composes the constituent factories
27 * into a data context.
28 *
29 * @author Evan Ward
30 * @since 10.1
31 */
32 public class CompositeDataContext implements DataContext {
33
34 /** Time scales in this data context. */
35 private final TimeScales timeScales;
36 /** Frames in this data context. */
37 private final Frames frames;
38 /** Celestial bodies in this data context. */
39 private final CelestialBodies celestialBodies;
40 /** Gravity fields in this data context. */
41 private final GravityFields gravityFields;
42 /** Magnetic fields in this data context. */
43 private final GeoMagneticFields geoMagneticFields;
44
45 /**
46 * Simple constructor.
47 *
48 * @param timeScales used in this data context.
49 * @param frames used in this data context.
50 * @param celestialBodies used in this data context.
51 * @param gravityFields used in this data context.
52 * @param geoMagneticFields used in this data context.
53 */
54 public CompositeDataContext(final TimeScales timeScales,
55 final Frames frames,
56 final CelestialBodies celestialBodies,
57 final GravityFields gravityFields,
58 final GeoMagneticFields geoMagneticFields) {
59 this.timeScales = timeScales;
60 this.frames = frames;
61 this.celestialBodies = celestialBodies;
62 this.gravityFields = gravityFields;
63 this.geoMagneticFields = geoMagneticFields;
64 }
65
66 @Override
67 public TimeScales getTimeScales() {
68 return timeScales;
69 }
70
71 @Override
72 public Frames getFrames() {
73 return frames;
74 }
75
76 @Override
77 public CelestialBodies getCelestialBodies() {
78 return celestialBodies;
79 }
80
81 @Override
82 public GravityFields getGravityFields() {
83 return gravityFields;
84 }
85
86 @Override
87 public GeoMagneticFields getGeoMagneticFields() {
88 return geoMagneticFields;
89 }
90
91 }