docs/DesignPatterns

annotate 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
rev   line source
meillo@7 1 class Leaf implements IComponent {
meillo@7 2 private String id;
meillo@7 3
meillo@7 4 public Leaf(String id) {
meillo@7 5 this.id = id;
meillo@7 6 }
meillo@7 7
meillo@7 8 public String toString() {
meillo@7 9 return this.id;
meillo@7 10 }
meillo@7 11
meillo@7 12 public Collection getChildren() {
meillo@7 13 return null;
meillo@7 14 }
meillo@7 15
meillo@7 16 // false because failed to add
meillo@7 17 public boolean addComponent(IComponent c) {
meillo@7 18 return false;
meillo@7 19 }
meillo@7 20
meillo@7 21 // false because failed to find it for removal
meillo@7 22 public boolean removeComponent(IComponent c) {
meillo@7 23 return false;
meillo@7 24 }
meillo@7 25 }