1 16 17 package org.apache.commons.betwixt; 18 19 import java.util.ArrayList ; 20 import java.util.Iterator ; 21 22 27 public class DoubleLinkedParentBean { 28 29 private ArrayList children = new ArrayList (); 30 private String name; 31 32 public DoubleLinkedParentBean () {} 33 34 public DoubleLinkedParentBean(String name) { 35 setName(name); 36 } 37 38 public String getName() { 39 return name; 40 } 41 42 public void setName(String name) { 43 this.name = name; 44 } 45 46 public Iterator getChildren() { 47 return children.iterator(); 48 } 49 50 public int getSize() { 51 return children.size(); 52 } 53 54 55 public void addChild(DoubleLinkedChildBean child) { 56 children.add(child); 57 child.setParent(this); 58 } 59 } 60 61 | Popular Tags |