Class StringConstant

java.lang.Object
javafx.beans.binding.StringExpression
com.sun.javafx.binding.StringConstant
All Implemented Interfaces:
Observable, ObservableObjectValue<String>, ObservableStringValue, ObservableValue<String>

public class StringConstant extends StringExpression
  • Method Details

    • valueOf

      public static StringConstant valueOf(String value)
    • get

      public String get()
      Description copied from interface: ObservableObjectValue
      Returns the current value of this ObservableObjectValue<T>.
      Returns:
      The current value
    • getValue

      public String getValue()
      Description copied from interface: ObservableValue
      Returns the current value of this ObservableValue
      Specified by:
      getValue in interface ObservableValue<String>
      Overrides:
      getValue in class StringExpression
      Returns:
      The current value
    • addListener

      public void addListener(InvalidationListener observer)
      Description copied from interface: Observable
      Adds an InvalidationListener which will be notified whenever the Observable becomes invalid. If the same listener is added more than once, then it will be notified more than once. That is, no check is made to ensure uniqueness.

      Note that the same actual InvalidationListener instance may be safely registered for different Observables.

      The Observable stores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak. It is recommended to either unregister a listener by calling removeListener after use or to use an instance of WeakInvalidationListener avoid this situation.

      Parameters:
      observer - The listener to register
      See Also:
    • addListener

      public void addListener(ChangeListener<? super String> observer)
      Description copied from interface: ObservableValue
      Adds a ChangeListener which will be notified whenever the value of the ObservableValue changes. If the same listener is added more than once, then it will be notified more than once. That is, no check is made to ensure uniqueness.

      Note that the same actual ChangeListener instance may be safely registered for different ObservableValues.

      The ObservableValue stores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak. It is recommended to either unregister a listener by calling removeListener after use or to use an instance of WeakChangeListener avoid this situation.

      Parameters:
      observer - The listener to register
      See Also:
    • removeListener

      public void removeListener(InvalidationListener observer)
      Description copied from interface: Observable
      Removes the given listener from the list of listeners, that are notified whenever the value of the Observable becomes invalid.

      If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.

      Parameters:
      observer - The listener to remove
      See Also:
    • removeListener

      public void removeListener(ChangeListener<? super String> observer)
      Description copied from interface: ObservableValue
      Removes the given listener from the list of listeners, that are notified whenever the value of the ObservableValue changes.

      If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.

      Parameters:
      observer - The listener to remove
      See Also: