Package Behavioral.Observer
Class ConcreteSubject
java.lang.Object
Behavioral.Observer.Subject
Behavioral.Observer.ConcreteSubject
Concrete implementation of a Subject in the Observer pattern.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Behavioral.Observer.Subject
attach, detach, notifyObservers
-
Constructor Details
-
ConcreteSubject
public ConcreteSubject()Default constructor for ConcreteSubject.
-
-
Method Details
-
getState
Gets the state of the subject.- Returns:
- The current state of the subject.
-
setState
Sets the state of the subject and notifies observers.- Parameters:
state- The new state of the subject.
-