docs/DesignPatterns
view code/composite-leaf.java @ 28:ddd8378a539e
did lot of working on detailed-observer
author | meillo@marmaro.de |
---|---|
date | Thu, 05 Jul 2007 07:53:15 +0200 |
parents | |
children |
line source
1 class Leaf implements IComponent {
2 private String id;
4 public Leaf(String id) {
5 this.id = id;
6 }
8 public String toString() {
9 return this.id;
10 }
12 public Collection getChildren() {
13 return null;
14 }
16 // false because failed to add
17 public boolean addComponent(IComponent c) {
18 return false;
19 }
21 // false because failed to find it for removal
22 public boolean removeComponent(IComponent c) {
23 return false;
24 }
25 }