for (int j=0; j < componentData.size(); j++) { BaseComponent baseComponent = new BaseCDataComponent((ComponentData)componentData.get(j)); baseComponent.initProperties(); addChild(baseComponent); }
  private void initFromCData() {    // create society properties from cdata    // create agents from cdata    ArrayList agentData = new ArrayList();    ArrayList alldata = new ArrayList();    if (cdata != null)      alldata.add(cdata);        // FIXME: It'd be nice to deal with binders of Agents in here!!!    // Find all the agents    for (int i = 0; i < alldata.size(); i++) {      ComponentData someData = (ComponentData)alldata.get(i);      if (someData.getType().equals(ComponentData.AGENT)) {        agentData.add(someData);      } else {        ComponentData[] moreData = someData.getChildren();        for (int j = 0; j < moreData.length; j++)           alldata.add(moreData[j]);      }    }    // For each agent, create a component and add it as a child    for (int i = 0; i < agentData.size(); i++) {      AgentComponent agentComponent =         new AgentCDataComponent((ComponentData)agentData.get(i));      agentComponent.initProperties();      addChild(agentComponent);    }  }