Package jsl.observers

Class TestObserverableObserver.Observable

    • Constructor Summary

      Constructors 
      Constructor Description
      Observable()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addObserver​(ObserverIfc observer)
      Allows the adding (attaching) of an observer to the observable
      void changeState()  
      boolean contains​(ObserverIfc observer)
      Returns true if the observer is already attached
      int countObservers()
      Returns how many observers are currently observing the observable
      void deleteObserver​(ObserverIfc observer)
      Allows the deletion (removing) of an observer from the observable
      void deleteObservers()
      Deletes all the observers from the observable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Observable

        public Observable()
    • Method Detail

      • addObserver

        public void addObserver​(ObserverIfc observer)
        Description copied from interface: ObservableIfc
        Allows the adding (attaching) of an observer to the observable
        Specified by:
        addObserver in interface ObservableIfc
        Parameters:
        observer - the observer to attach
      • deleteObserver

        public void deleteObserver​(ObserverIfc observer)
        Description copied from interface: ObservableIfc
        Allows the deletion (removing) of an observer from the observable
        Specified by:
        deleteObserver in interface ObservableIfc
        Parameters:
        observer - the observer to delete
      • contains

        public boolean contains​(ObserverIfc observer)
        Description copied from interface: ObservableIfc
        Returns true if the observer is already attached
        Specified by:
        contains in interface ObservableIfc
        Parameters:
        observer - the observer to check
        Returns:
        true if attached
      • countObservers

        public int countObservers()
        Description copied from interface: ObservableIfc
        Returns how many observers are currently observing the observable
        Specified by:
        countObservers in interface ObservableIfc
        Returns:
        number of observers
      • changeState

        public void changeState()