Class AbstractObservable

    • Constructor Detail

      • AbstractObservable

        public AbstractObservable​(Realm realm)
        Parameters:
        realm -
    • Method Detail

      • addChangeListener

        public void addChangeListener​(IChangeListener listener)
        Description copied from interface: IObservable
        Adds the given change listener to the list of change listeners. Change listeners are notified about changes of the state of this observable in a generic way, without specifying the change that happened. To get the changed state, a change listener needs to query for the current state of this observable.
        Specified by:
        addChangeListener in interface IObservable
      • removeChangeListener

        public void removeChangeListener​(IChangeListener listener)
        Description copied from interface: IObservable
        Removes the given change listener from the list of change listeners. Has no effect if the given listener is not registered as a change listener.
        Specified by:
        removeChangeListener in interface IObservable
      • addStaleListener

        public void addStaleListener​(IStaleListener listener)
        Description copied from interface: IObservable
        Adds the given stale listener to the list of stale listeners. Stale listeners are notified when an observable object becomes stale, not when is becomes non-stale.
        Specified by:
        addStaleListener in interface IObservable
        See Also:
        IObservable.isStale()
      • removeStaleListener

        public void removeStaleListener​(IStaleListener listener)
        Description copied from interface: IObservable
        Removes the given stale listener from the list of stale listeners. Has no effect if the given listener is not registered as a stale listener.
        Specified by:
        removeStaleListener in interface IObservable
      • addDisposeListener

        public void addDisposeListener​(IDisposeListener listener)
        Description copied from interface: IObservable
        Adds the given dispose listener to the list of dispose listeners. Dispose listeners are notified when an observable has been disposed.
        Specified by:
        addDisposeListener in interface IObservable
        Parameters:
        listener - the listener to add
        Since:
        1.2
      • removeDisposeListener

        public void removeDisposeListener​(IDisposeListener listener)
        Description copied from interface: IObservable
        Removes the given dispose listener from the list of dispose listeners. Has no effect if the given listener is not registered as a dispose listener.
        Specified by:
        removeDisposeListener in interface IObservable
        Parameters:
        listener - the listener to remove
        Since:
        1.2
      • fireChange

        protected void fireChange()
      • fireStale

        protected void fireStale()
      • isDisposed

        public boolean isDisposed()
        Description copied from interface: IObservable
        Returns whether the observable has been disposed
        Specified by:
        isDisposed in interface IObservable
        Returns:
        whether the observable has been disposed
        Since:
        1.2
      • 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
      • addListener

        protected void addListener​(Object listenerType,
                                   IObservablesListener listener)
        Parameters:
        listenerType -
        listener -
      • removeListener

        protected void removeListener​(Object listenerType,
                                      IObservablesListener listener)
        Parameters:
        listenerType -
        listener -
      • hasListeners

        protected boolean hasListeners()
      • firstListenerAdded

        protected void firstListenerAdded()
      • lastListenerRemoved

        protected void lastListenerRemoved()
      • getRealm

        public Realm getRealm()
        Returns:
        Returns the realm.