docs/DesignPatterns

annotate code/composite-main.java @ 37:debbd3bf76ce

Added tag Ausarbeitung final for changeset f03413250b39d73ca44b22ea1e4022fd3c9e825d
author meillo@marmaro.de
date Sat, 11 Aug 2007 22:43:34 +0200
parents
children
rev   line source
meillo@7 1 public class Main {
meillo@7 2 public static void main(String[] args) {
meillo@7 3 Composite england = new Composite("England");
meillo@7 4 Leaf york = new Leaf("York");
meillo@7 5 Leaf london = new Leaf("London");
meillo@7 6 england.addComponent(york);
meillo@7 7 england.addComponent(london);
meillo@7 8 england.removeComponent(york);
meillo@7 9
meillo@7 10 Composite france = new Composite("France");
meillo@7 11 france.addComponent(new Leaf("Paris"));
meillo@7 12
meillo@7 13 Composite europe = new Composite("Europe");
meillo@7 14 europe.addComponent(england);
meillo@7 15 europe.addComponent(france);
meillo@7 16
meillo@7 17 System.out.println(europe.toString());
meillo@7 18 }
meillo@7 19 }