Mercurial > docs > DesignPatterns
annotate code/composite-leaf.java @ 36:f03413250b39 Ausarbeitung final
some typos and cleanups
author | meillo@marmaro.de |
---|---|
date | Sat, 11 Aug 2007 22:42:24 +0200 |
parents | 20c0116dcb97 |
children |
rev | line source |
---|---|
7 | 1 class Leaf implements IComponent { |
2 private String id; | |
3 | |
4 public Leaf(String id) { | |
5 this.id = id; | |
6 } | |
7 | |
8 public String toString() { | |
9 return this.id; | |
10 } | |
11 | |
12 public Collection getChildren() { | |
13 return null; | |
14 } | |
15 | |
16 // false because failed to add | |
17 public boolean addComponent(IComponent c) { | |
18 return false; | |
19 } | |
20 | |
21 // false because failed to find it for removal | |
22 public boolean removeComponent(IComponent c) { | |
23 return false; | |
24 } | |
25 } |