ParameterObserver.java

  1. /* Copyright 2002-2022 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.      */
  29.     void valueChanged(double previousValue, ParameterDriver driver);

  30.     /** Notify that a parameter reference date has been changed.
  31.      * <p>
  32.      * The default implementation does nothing
  33.      * </p>
  34.      * @param previousReferenceDate previous date (null if it is the first time
  35.      * the reference date is changed)
  36.      * @param driver parameter driver that has been changed
  37.      * @since 9.0
  38.      */
  39.     default void referenceDateChanged(final AbsoluteDate previousReferenceDate, final ParameterDriver driver) {
  40.         // nothing by default
  41.     }

  42.     /** Notify that a parameter name has been changed.
  43.      * <p>
  44.      * The default implementation does nothing
  45.      * </p>
  46.      * @param previousName previous name
  47.      * @param driver parameter driver that has been changed
  48.      * @since 9.0
  49.      */
  50.     default void nameChanged(final String previousName, final ParameterDriver driver) {
  51.         // nothing by default
  52.     }

  53.     /** Notify that a parameter selection status has been changed.
  54.      * <p>
  55.      * The default implementation does nothing
  56.      * </p>
  57.      * @param previousSelection previous selection
  58.      * @param driver parameter driver that has been changed
  59.      * @since 9.0
  60.      */
  61.     default void selectionChanged(final boolean previousSelection, final ParameterDriver driver) {
  62.         // nothing by default
  63.     }

  64.     /** Notify that a parameter reference value has been changed.
  65.      * <p>
  66.      * The default implementation does nothing
  67.      * </p>
  68.      * @param previousReferenceValue previous reference value
  69.      * @param driver parameter driver that has been changed
  70.      * @since 9.0
  71.      */
  72.     default void referenceValueChanged(final double previousReferenceValue, final ParameterDriver driver) {
  73.         // nothing by default
  74.     }

  75.     /** Notify that a parameter minimum value has been changed.
  76.      * <p>
  77.      * The default implementation does nothing
  78.      * </p>
  79.      * @param previousMinValue previous minimum value
  80.      * @param driver parameter driver that has been changed
  81.      * @since 9.0
  82.      */
  83.     default void minValueChanged(final double previousMinValue, final ParameterDriver driver) {
  84.         // nothing by default
  85.     }

  86.     /** Notify that a parameter maximum value has been changed.
  87.      * <p>
  88.      * The default implementation does nothing
  89.      * </p>
  90.      * @param previousMaxValue previous maximum value
  91.      * @param driver parameter driver that has been changed
  92.      * @since 9.0
  93.      */
  94.     default void maxValueChanged(final double previousMaxValue, final ParameterDriver driver) {
  95.         // nothing by default
  96.     }

  97.     /** Notify that a parameter scale has been changed.
  98.      * <p>
  99.      * The default implementation does nothing
  100.      * </p>
  101.      * @param previousScale previous scale
  102.      * @param driver parameter driver that has been changed
  103.      * @since 9.0
  104.      */
  105.     default void scaleChanged(final double previousScale, final ParameterDriver driver) {
  106.         // nothing by default
  107.     }

  108. }