public class TestDecorators {

	public static void main(String[] args) {

		Application app1 = new Application();
		app1.name = "Smith";
		app1.gpa = new Double(3.5);
		app1.gre = new Double(512);
		app1.mcat = new Double(515);
		app1.lsat = new Double(412);
		app1.toefl = new Double(312);

		AdmissionsCalculator calc = new AdmissionsCalculator();

		IEvaluator last = new GPAEvaluatorAdapter();

		IEvaluator chain1 =
		   new LSATDecorator(
			   new GREDecorator(
				   last));

		IEvaluator chain2 =
		   new MCATDecorator(
			   new GREDecorator(
				   last));

		IEvaluator chain3 =
		   new TOEFLDecorator(
				   last);

	    calc.setEvaluator(chain1);
	    calc.eval(app1);
	    System.out.println("accepted = " + app1.accepted);

	    calc.setEvaluator(chain2);
	    calc.eval(app1);
	    System.out.println("accepted = " + app1.accepted);

	    calc.setEvaluator(chain3);
	    calc.eval(app1);
	    System.out.println("accepted = " + app1.accepted);

	}

}