< prev index next >

modules/javafx.base/src/main/java/javafx/beans/value/ChangeListener.java

Print this page




  33  * <p>
  34  * For an in-depth explanation of change events and how they differ from
  35  * invalidation events, see the documentation of {@code ObservableValue}.
  36  * <p>
  37  * The same instance of {@code ChangeListener} can be registered to listen to
  38  * multiple {@code ObservableValues}.
  39  *
  40  * @see ObservableValue
  41  *
  42  *
  43  * @since JavaFX 2.0
  44  */
  45 @FunctionalInterface
  46 public interface ChangeListener<T> {
  47 
  48     /**
  49      * This method needs to be provided by an implementation of
  50      * {@code ChangeListener}. It is called if the value of an
  51      * {@link ObservableValue} changes.
  52      * <p>
  53      * In general is is considered bad practice to modify the observed value in
  54      * this method.
  55      *
  56      * @param observable
  57      *            The {@code ObservableValue} which value changed
  58      * @param oldValue
  59      *            The old value
  60      * @param newValue
  61      *            The new value
  62      */
  63     void changed(ObservableValue<? extends T> observable, T oldValue, T newValue);
  64 }


  33  * <p>
  34  * For an in-depth explanation of change events and how they differ from
  35  * invalidation events, see the documentation of {@code ObservableValue}.
  36  * <p>
  37  * The same instance of {@code ChangeListener} can be registered to listen to
  38  * multiple {@code ObservableValues}.
  39  *
  40  * @see ObservableValue
  41  *
  42  *
  43  * @since JavaFX 2.0
  44  */
  45 @FunctionalInterface
  46 public interface ChangeListener<T> {
  47 
  48     /**
  49      * This method needs to be provided by an implementation of
  50      * {@code ChangeListener}. It is called if the value of an
  51      * {@link ObservableValue} changes.
  52      * <p>
  53      * In general, it is considered bad practice to modify the observed value in
  54      * this method.
  55      *
  56      * @param observable
  57      *            The {@code ObservableValue} which value changed
  58      * @param oldValue
  59      *            The old value
  60      * @param newValue
  61      *            The new value
  62      */
  63     void changed(ObservableValue<? extends T> observable, T oldValue, T newValue);
  64 }
< prev index next >