CompositeDataContext.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.data;

  18. import org.orekit.bodies.CelestialBodies;
  19. import org.orekit.forces.gravity.potential.GravityFields;
  20. import org.orekit.frames.Frames;
  21. import org.orekit.models.earth.GeoMagneticFields;
  22. import org.orekit.time.TimeScales;

  23. /**
  24.  * A simple implementation of {@link DataContext} that composes the constituent factories
  25.  * into a data context.
  26.  *
  27.  * @author Evan Ward
  28.  * @since 10.1
  29.  */
  30. public class CompositeDataContext implements DataContext {

  31.     /** Time scales in this data context. */
  32.     private final TimeScales timeScales;
  33.     /** Frames in this data context. */
  34.     private final Frames frames;
  35.     /** Celestial bodies in this data context. */
  36.     private final CelestialBodies celestialBodies;
  37.     /** Gravity fields in this data context. */
  38.     private final GravityFields gravityFields;
  39.     /** Magnetic fields in this data context. */
  40.     private final GeoMagneticFields geoMagneticFields;

  41.     /**
  42.      * Simple constructor.
  43.      *
  44.      * @param timeScales        used in this data context.
  45.      * @param frames            used in this data context.
  46.      * @param celestialBodies   used in this data context.
  47.      * @param gravityFields     used in this data context.
  48.      * @param geoMagneticFields used in this data context.
  49.      */
  50.     public CompositeDataContext(final TimeScales timeScales,
  51.                                 final Frames frames,
  52.                                 final CelestialBodies celestialBodies,
  53.                                 final GravityFields gravityFields,
  54.                                 final GeoMagneticFields geoMagneticFields) {
  55.         this.timeScales = timeScales;
  56.         this.frames = frames;
  57.         this.celestialBodies = celestialBodies;
  58.         this.gravityFields = gravityFields;
  59.         this.geoMagneticFields = geoMagneticFields;
  60.     }

  61.     @Override
  62.     public TimeScales getTimeScales() {
  63.         return timeScales;
  64.     }

  65.     @Override
  66.     public Frames getFrames() {
  67.         return frames;
  68.     }

  69.     @Override
  70.     public CelestialBodies getCelestialBodies() {
  71.         return celestialBodies;
  72.     }

  73.     @Override
  74.     public GravityFields getGravityFields() {
  75.         return gravityFields;
  76.     }

  77.     @Override
  78.     public GeoMagneticFields getGeoMagneticFields() {
  79.         return geoMagneticFields;
  80.     }

  81. }