1   /* Copyright 2022-2025 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  
19  import org.hipparchus.CalculusFieldElement;
20  
21  /** Abstract base class for modifying state during propagation.
22   * <p>
23   * This class is a specialized implementation of {@link FieldAdditionalDataProvider}
24   * with a name set to the empty string and returning a null additional data.
25   * </p>
26   * <p>
27   * Beware that changing the state undercover from the propagator may have
28   * many side effects. Using this class should therefore be done cautiously.
29   * </p>
30   * @see Propagator
31   * @see FieldAdditionalDataProvider
32   * @author Luc Maisonobe
33   * @param <T> type of the field elements
34   * @since 12.1
35   */
36  public abstract class FieldAbstractStateModifier<T extends CalculusFieldElement<T>>
37      implements FieldAdditionalDataProvider<T[], T> {
38  
39      /** {@inheritDoc} */
40      @Override
41      public String getName() {
42          return "";
43      }
44  
45      /** {@inheritDoc} */
46      @Override
47      public T[] getAdditionalData(final FieldSpacecraftState<T> state) {
48          return null;
49      }
50  
51      /** {@inheritDoc} */
52      @Override
53      public FieldSpacecraftState<T> update(final FieldSpacecraftState<T> state) {
54          return change(state);
55      }
56  
57      /** Change main state.
58       * @param state spacecraft state to change
59       * @return changed state
60       */
61      public abstract FieldSpacecraftState<T> change(FieldSpacecraftState<T> state);
62  
63  }