package composite; import java.util.Iterator; public class Catalog extends Part { public Catalog(String name, String descr, String keywords) { super(name, descr, keywords); } @Override public String getName() { StringBuffer res = new StringBuffer(name); for (Iterator iter = inners.iterator(); iter.hasNext();) { SitePage innerPage = (SitePage) iter.next(); res.append("/").append(innerPage.getName()); } return res.toString(); } }