docs/DesignPatterns

annotate code/composite-leaf.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 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 }