docs/DesignPatterns
view 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 |
line source
1 public class Main {
2 public static void main(String[] args) {
3 Composite england = new Composite("England");
4 Leaf york = new Leaf("York");
5 Leaf london = new Leaf("London");
6 england.addComponent(york);
7 england.addComponent(london);
8 england.removeComponent(york);
10 Composite france = new Composite("France");
11 france.addComponent(new Leaf("Paris"));
13 Composite europe = new Composite("Europe");
14 europe.addComponent(england);
15 europe.addComponent(france);
17 System.out.println(europe.toString());
18 }
19 }