1   /* Copyright 2002-2024 CS GROUP
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.utils;
18  
19  import org.orekit.time.AbsoluteDate;
20  
21  
22  /** Interface for observing parameters changes.
23   * @see ParameterDriver
24   * @author Luc Maisonobe
25   * @since 8.0
26   */
27  public interface ParameterObserver {
28  
29      /** Notify that a parameter value has been changed.
30       * @param previousValue previous value
31       * @param driver parameter driver that has been changed
32       * @param date date for which the parameter value have been updated
33       */
34      void valueChanged(double previousValue, ParameterDriver driver, AbsoluteDate date);
35  
36      /** Notify that a parameter value span map has been changed.
37       * @param previousValueSpanMap previous value
38       * @param driver parameter driver that has been changed
39       */
40      void valueSpanMapChanged(TimeSpanMap<Double> previousValueSpanMap, ParameterDriver driver);
41  
42      /** Notify that a parameter reference date has been changed.
43       * <p>
44       * The default implementation does nothing
45       * </p>
46       * @param previousReferenceDate previous date (null if it is the first time
47       * the reference date is changed)
48       * @param driver parameter driver that has been changed
49       * @since 9.0
50       */
51      default void referenceDateChanged(final AbsoluteDate previousReferenceDate, final ParameterDriver driver) {
52          // nothing by default
53      }
54  
55      /** Notify that a parameter name has been changed.
56       * <p>
57       * The default implementation does nothing
58       * </p>
59       * @param previousName previous name
60       * @param driver parameter driver that has been changed
61       * @since 9.0
62       */
63      default void nameChanged(final String previousName, final ParameterDriver driver) {
64          // nothing by default
65      }
66  
67      /** Notify that a parameter selection status has been changed.
68       * <p>
69       * The default implementation does nothing
70       * </p>
71       * @param previousSelection previous selection
72       * @param driver parameter driver that has been changed
73       * @since 9.0
74       */
75      default void selectionChanged(final boolean previousSelection, final ParameterDriver driver) {
76          // nothing by default
77      }
78  
79      /** Notify that a parameter estimation type (continuous or step) has been changed.
80       * <p>
81       * The default implementation does nothing
82       * </p>
83       * @param previousIsContinuous previous estimation type, continuous estimation if true,
84       * step estimation if not.
85       * @param driver parameter driver that has been changed
86       * @since 9.0
87       */
88      default void estimationTypeChanged(final boolean previousIsContinuous, final ParameterDriver driver) {
89          // nothing by default
90      }
91  
92      /** Notify that a parameter reference value has been changed.
93       * <p>
94       * The default implementation does nothing
95       * </p>
96       * @param previousReferenceValue previous reference value
97       * @param driver parameter driver that has been changed
98       * @since 9.0
99       */
100     default void referenceValueChanged(final double previousReferenceValue, final ParameterDriver driver) {
101         // nothing by default
102     }
103 
104     /** Notify that a parameter minimum value has been changed.
105      * <p>
106      * The default implementation does nothing
107      * </p>
108      * @param previousMinValue previous minimum value
109      * @param driver parameter driver that has been changed
110      * @since 9.0
111      */
112     default void minValueChanged(final double previousMinValue, final ParameterDriver driver) {
113         // nothing by default
114     }
115 
116     /** Notify that a parameter maximum value has been changed.
117      * <p>
118      * The default implementation does nothing
119      * </p>
120      * @param previousMaxValue previous maximum value
121      * @param driver parameter driver that has been changed
122      * @since 9.0
123      */
124     default void maxValueChanged(final double previousMaxValue, final ParameterDriver driver) {
125         // nothing by default
126     }
127 
128     /** Notify that a parameter scale has been changed.
129      * <p>
130      * The default implementation does nothing
131      * </p>
132      * @param previousScale previous scale
133      * @param driver parameter driver that has been changed
134      * @since 9.0
135      */
136     default void scaleChanged(final double previousScale, final ParameterDriver driver) {
137         // nothing by default
138     }
139 
140 }