package com.iluwatar.mediator;

/**
 * 
 * Mediator encapsulates how a set of objects ({@link PartyMember}) interact. Instead of
 * referring to each other directly they use a mediator ({@link Party}) interface.
 * 
 */
public class App {

	/**
	 * Program entry point
	 * @param args command line args
	 */
	public static void main(String[] args) {
		
		// create party and members
		Party party = new PartyImpl();
		Hobbit hobbit = new Hobbit();
		Wizard wizard = new Wizard();
		Rogue rogue = new Rogue();
		Hunter hunter = new Hunter();

		// add party members
		party.addMember(hobbit);
		party.addMember(wizard);
		party.addMember(rogue);
		party.addMember(hunter);

		// perform actions -> the other party members
		// are notified by the party
		hobbit.act(Action.ENEMY);
		wizard.act(Action.TALE);
		rogue.act(Action.GOLD);
		hunter.act(Action.HUNT);
	}
}

@@ -35,16 +35,20 @@
 *%0A * %0A *
+ The
  Mediato
@@ -49,16 +49,1073 @@
 ediator 
+pattern defines an object that encapsulates how a set of objects %0A * interact. This pattern is considered to be a behavioral pattern due to the way %0A * it can alter the program's running behavior.%0A * %3Cp%3E%0A * Usually a program is made up of a large number of classes. So the logic and %0A * computation is distributed among these classes. However, as more classes are %0A * developed in a program, especially during maintenance and/or refactoring, %0A * the problem of communication between these classes may become more complex. %0A * This makes the program harder to read and maintain. Furthermore, it can become %0A * difficult to change the program, since any change may affect code in several %0A * other classes.%0A * %3Cp%3E%0A * With the Mediator pattern, communication between objects is encapsulated with %0A * a mediator object. Objects no longer communicate directly with each other, but %0A * instead communicate through the mediator. This reduces the dependencies between %0A * communicating objects, thereby lowering the coupling.%0A * %3Cp%3E%0A * In this example the mediator 
 encapsul
@@ -1162,16 +1162,20 @@
 ember%7D) 
+%0A * 
 interact
@@ -1186,19 +1186,16 @@
 stead of
-%0A *
  referri
@@ -1229,17 +1229,19 @@
 hey use 
-a
+the
  mediato
@@ -1242,16 +1242,20 @@
 ediator 
+%0A * 
 (%7B@link 

Improve Mediator Javadoc