Package cs.eng1.piazzapanic.observable
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addSubject(Subject<T> subject)
void
deregisterFromAllSubjects()
java.util.List<Subject<T>>
getSubjects()
void
removeSubject(Subject<T> subject)
void
update(T update)
Lets the implementation of Observer deal with the new value that was set in the Subject.
-
-
-
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.
-
deregisterFromAllSubjects
void deregisterFromAllSubjects()
-
-