Package Behavioral.Mediator
Class Colleague
java.lang.Object
Behavioral.Mediator.Colleague
- Direct Known Subclasses:
ConcreteColleague
Abstract base class for Colleagues in the Mediator Pattern.
Colleagues communicate with each other through the Mediator.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
mediator
Reference to the Mediator
-
-
Constructor Details
-
Colleague
Constructor to associate the colleague with a mediator.- Parameters:
mediator- The mediator instance.
-
-
Method Details
-
send
Sends a message via the mediator.- Parameters:
message- The message to send.
-
receive
Handles a received message.- Parameters:
message- The message received.
-