Class DecoratingObservableValue<T>

    • Constructor Detail

      • DecoratingObservableValue

        public DecoratingObservableValue​(IObservableValue<T> decorated,
                                         boolean disposeDecoratedOnDispose)
        Constructs a DecoratingObservableValue which decorates the given observable.
        Parameters:
        decorated - the observable value being decorated
        disposeDecoratedOnDispose - whether the decorated observable should be disposed when the decorator is disposed
    • Method Detail

      • fireValueChange

        protected void fireValueChange​(ValueDiff<T> diff)
      • handleValueChange

        protected void handleValueChange​(ValueChangeEvent<? extends T> event)
        Called whenever a ValueChangeEvent is received from the decorated observable. By default, this method fires the value change event again, with the decorating observable as the event source. Subclasses may override to provide different behavior.
        Parameters:
        event - the change event received from the decorated observable
      • getValue

        public T getValue()
        Description copied from interface: IObservableValue
        Returns the value. Must be invoked in the Realm of the observable.
        Specified by:
        getValue in interface IObservableValue<T>
        Returns:
        the current value
      • setValue

        public void setValue​(T value)
        Description copied from interface: IObservableValue
        Sets the value. Must be invoked in the Realm of the observable.
        Specified by:
        setValue in interface IObservableValue<T>
        Parameters:
        value - the value to set
      • getValueType

        public Object getValueType()
        Description copied from interface: IObservableValue
        The value type of this observable value, or null if this observable value is untyped.
        Specified by:
        getValueType in interface IObservableValue<T>
        Returns:
        the value type, or null
      • dispose

        public void dispose()
        Description copied from interface: IObservable
        Disposes of this observable object, removing all listeners registered with this object, and all listeners this object might have registered on other objects.
        Specified by:
        dispose in interface IObservable
        Overrides:
        dispose in class DecoratingObservable
      • addListener

        protected void addListener​(Object listenerType,
                                   IObservablesListener listener)
        Parameters:
        listenerType - arbitrary object to identify a type of the listener
        listener - the listener to add; not null
      • removeListener

        protected void removeListener​(Object listenerType,
                                      IObservablesListener listener)
        Parameters:
        listenerType - arbitrary object to identify a type of the listener
        listener - the listener to remove; not null
      • hasListeners

        protected boolean hasListeners()
      • getRealm

        public Realm getRealm()
        Returns:
        Returns the realm.