AbstractStateModifier.java

  1. /* Copyright 2002-2024 Thales Alenia Space
  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.propagation;

  18. /** Abstract base class for modifying state during propagation.
  19.  * <p>
  20.  * This class is a specialized implementation of {@link AdditionalStateProvider}
  21.  * with a name set to the empty string and returning a null additional state.
  22.  * </p>
  23.  * <p>
  24.  * Beware that changing the state undercover from the propagator may have
  25.  * many side effects. Using this class should therefore be done cautiously.
  26.  * </p>
  27.  * @see Propagator
  28.  * @see AdditionalStateProvider
  29.  * @author Luc Maisonobe
  30.  * @since 12.1
  31.  */
  32. public abstract class AbstractStateModifier implements AdditionalStateProvider {

  33.     /** {@inheritDoc} */
  34.     @Override
  35.     public String getName() {
  36.         return "";
  37.     }

  38.     /** {@inheritDoc} */
  39.     @Override
  40.     public double[] getAdditionalState(final SpacecraftState state) {
  41.         return null;
  42.     }

  43.     /** {@inheritDoc} */
  44.     @Override
  45.     public SpacecraftState update(final SpacecraftState state) {
  46.         return change(state);
  47.     }
  48.     /** Change main state.
  49.      * @param state spacecraft state to change
  50.      * @return changed state
  51.      */
  52.     public abstract SpacecraftState change(SpacecraftState state);

  53. }