ParameterObserver.java

  1. /* Copyright 2002-2025 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. import org.orekit.time.AbsoluteDate;


  19. /** Interface for observing parameters changes.
  20.  * @see ParameterDriver
  21.  * @author Luc Maisonobe
  22.  * @since 8.0
  23.  */
  24. public interface ParameterObserver {

  25.     /** Notify that a parameter value has been changed.
  26.      * @param previousValue previous value
  27.      * @param driver parameter driver that has been changed
  28.      * @param date date for which the parameter value have been updated
  29.      */
  30.     void valueChanged(double previousValue, ParameterDriver driver, AbsoluteDate date);

  31.     /** Notify that a parameter value span map has been changed.
  32.      * @param previousValueSpanMap previous value
  33.      * @param driver parameter driver that has been changed
  34.      */
  35.     void valueSpanMapChanged(TimeSpanMap<Double> previousValueSpanMap, ParameterDriver driver);

  36.     /** Notify that a parameter reference date has been changed.
  37.      * <p>
  38.      * The default implementation does nothing
  39.      * </p>
  40.      * @param previousReferenceDate previous date (null if it is the first time
  41.      * the reference date is changed)
  42.      * @param driver parameter driver that has been changed
  43.      * @since 9.0
  44.      */
  45.     default void referenceDateChanged(final AbsoluteDate previousReferenceDate, final ParameterDriver driver) {
  46.         // nothing by default
  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.     /** Notify that a parameter selection status has been changed.
  60.      * <p>
  61.      * The default implementation does nothing
  62.      * </p>
  63.      * @param previousSelection previous selection
  64.      * @param driver parameter driver that has been changed
  65.      * @since 9.0
  66.      */
  67.     default void selectionChanged(final boolean previousSelection, final ParameterDriver driver) {
  68.         // nothing by default
  69.     }

  70.     /** Notify that a parameter estimation type (continuous or step) has been changed.
  71.      * <p>
  72.      * The default implementation does nothing
  73.      * </p>
  74.      * @param previousIsContinuous previous estimation type, continuous estimation if true,
  75.      * step estimation if not.
  76.      * @param driver parameter driver that has been changed
  77.      * @since 9.0
  78.      */
  79.     default void estimationTypeChanged(final boolean previousIsContinuous, final ParameterDriver driver) {
  80.         // nothing by default
  81.     }

  82.     /** Notify that a parameter reference value has been changed.
  83.      * <p>
  84.      * The default implementation does nothing
  85.      * </p>
  86.      * @param previousReferenceValue previous reference value
  87.      * @param driver parameter driver that has been changed
  88.      * @since 9.0
  89.      */
  90.     default void referenceValueChanged(final double previousReferenceValue, final ParameterDriver driver) {
  91.         // nothing by default
  92.     }

  93.     /** Notify that a parameter minimum value has been changed.
  94.      * <p>
  95.      * The default implementation does nothing
  96.      * </p>
  97.      * @param previousMinValue previous minimum value
  98.      * @param driver parameter driver that has been changed
  99.      * @since 9.0
  100.      */
  101.     default void minValueChanged(final double previousMinValue, final ParameterDriver driver) {
  102.         // nothing by default
  103.     }

  104.     /** Notify that a parameter maximum value has been changed.
  105.      * <p>
  106.      * The default implementation does nothing
  107.      * </p>
  108.      * @param previousMaxValue previous maximum value
  109.      * @param driver parameter driver that has been changed
  110.      * @since 9.0
  111.      */
  112.     default void maxValueChanged(final double previousMaxValue, final ParameterDriver driver) {
  113.         // nothing by default
  114.     }

  115.     /** Notify that a parameter scale has been changed.
  116.      * <p>
  117.      * The default implementation does nothing
  118.      * </p>
  119.      * @param previousScale previous scale
  120.      * @param driver parameter driver that has been changed
  121.      * @since 9.0
  122.      */
  123.     default void scaleChanged(final double previousScale, final ParameterDriver driver) {
  124.         // nothing by default
  125.     }

  126. }