ParameterObserver.java

  1. /* Copyright 2002-2018 CS Systèmes d'Information
  2.  * Licensed to CS Systèmes d'Information (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.errors.OrekitException;
  19. import org.orekit.time.AbsoluteDate;


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

  26.     /** Notify that a parameter value has been changed.
  27.      * @param previousValue previous value
  28.      * @param driver parameter driver that has been changed
  29.      * @exception OrekitException if value is invalid for the driven model
  30.      */
  31.     void valueChanged(double previousValue, ParameterDriver driver) throws OrekitException;

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

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

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

  66. }