Interface PropertyValueObservable<T>

Type Parameters:
T - the type of the property value
All Known Implementing Classes:
BooleanProperty, IntegerProperty, LongProperty, ObjectProperty, StringProperty

public interface PropertyValueObservable<T>
Observable property value that notifies registered listeners on value changes.
Author:
渔民小镇
date:
2024-04-17
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Register a change listener to be notified when the value changes.
    Get the current property value.
    void
    Remove a previously registered change listener.
    void
    setValue(T value)
    Set the property value, triggering listeners if the value changed.
  • Method Details

    • addListener

      void addListener(PropertyChangeListener<? super T> listener)
      Register a change listener to be notified when the value changes.
      Parameters:
      listener - the listener to register
    • removeListener

      void removeListener(PropertyChangeListener<? super T> listener)
      Remove a previously registered change listener.
      Parameters:
      listener - the listener to remove
    • getValue

      T getValue()
      Get the current property value.
      Returns:
      the current value
    • setValue

      void setValue(T value)
      Set the property value, triggering listeners if the value changed.
      Parameters:
      value - the new value to set