1 /* Copyright 2002-2020 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 */
33 void valueChanged(double previousValue, ParameterDriver driver);
34
35 /** Notify that a parameter reference date has been changed.
36 * <p>
37 * The default implementation does nothing
38 * </p>
39 * @param previousReferenceDate previous date (null if it is the first time
40 * the reference date is changed)
41 * @param driver parameter driver that has been changed
42 * @since 9.0
43 */
44 default void referenceDateChanged(final AbsoluteDate previousReferenceDate, final ParameterDriver driver) {
45 // nothing by default
46 }
47
48 /** Notify that a parameter name has been changed.
49 * <p>
50 * The default implementation does nothing
51 * </p>
52 * @param previousName previous name
53 * @param driver parameter driver that has been changed
54 * @since 9.0
55 */
56 default void nameChanged(final String previousName, final ParameterDriver driver) {
57 // nothing by default
58 }
59
60 /** Notify that a parameter selection status has been changed.
61 * <p>
62 * The default implementation does nothing
63 * </p>
64 * @param previousSelection previous selection
65 * @param driver parameter driver that has been changed
66 * @since 9.0
67 */
68 default void selectionChanged(final boolean previousSelection, final ParameterDriver driver) {
69 // nothing by default
70 }
71
72 /** Notify that a parameter reference value has been changed.
73 * <p>
74 * The default implementation does nothing
75 * </p>
76 * @param previousReferenceValue previous reference value
77 * @param driver parameter driver that has been changed
78 * @since 9.0
79 */
80 default void referenceValueChanged(final double previousReferenceValue, final ParameterDriver driver) {
81 // nothing by default
82 }
83
84 /** Notify that a parameter minimum value has been changed.
85 * <p>
86 * The default implementation does nothing
87 * </p>
88 * @param previousMinValue previous minimum value
89 * @param driver parameter driver that has been changed
90 * @since 9.0
91 */
92 default void minValueChanged(final double previousMinValue, final ParameterDriver driver) {
93 // nothing by default
94 }
95
96 /** Notify that a parameter maximum value has been changed.
97 * <p>
98 * The default implementation does nothing
99 * </p>
100 * @param previousMaxValue previous maximum value
101 * @param driver parameter driver that has been changed
102 * @since 9.0
103 */
104 default void maxValueChanged(final double previousMaxValue, final ParameterDriver driver) {
105 // nothing by default
106 }
107
108 /** Notify that a parameter scale has been changed.
109 * <p>
110 * The default implementation does nothing
111 * </p>
112 * @param previousScale previous scale
113 * @param driver parameter driver that has been changed
114 * @since 9.0
115 */
116 default void scaleChanged(final double previousScale, final ParameterDriver driver) {
117 // nothing by default
118 }
119
120 }