Interface Observer<T>

  • Type Parameters:
    T - The class type that will be received every time this class receives an update.
    All Known Implementing Classes:
    ChoppingStation, CookingStation, IngredientStation, RecipeStation, Station

    public interface Observer<T>
    An observer can be implemented in a way where it can be registered with a Subject of the same type T which will contains a central value which notifies this observer every time that value changes.
    • Method Detail

      • update

        void update​(T update)
        Lets the implementation of Observer deal with the new value that was set in the Subject.
        Parameters:
        update - The message or value being passed from the Subject to this Observer.
      • addSubject

        void addSubject​(Subject<T> subject)
      • removeSubject

        void removeSubject​(Subject<T> subject)
      • getSubjects

        java.util.List<Subject<T>> getSubjects()
      • deregisterFromAllSubjects

        void deregisterFromAllSubjects()