preexistingItems.add(data); for (int i = 0, n = data.parameterCount(); i < n; i++) { preexistingItems.add(data.getParameter(i)); } AgentAssetData aad = data.getAgentAssetData(); if (aad != null) { for (int i = 0, n = aad.getRelationshipCount(); i < n; i++) { RelationshipData rd = aad.getRelationship(i); preexistingItems.add(rd); } } ComponentData[] children = data.getChildren(); for (int i = 0; i < children.length; i++) { setPreexistingItems(children[i]); }
    public void setPreexistingItems(ComponentData data) {        preexistingItems.add(data);        for (int i = 0, n = data.parameterCount(); i < n; i++) {            preexistingItems.add(data.getParameter(i));        }        AgentAssetData aad = data.getAgentAssetData();        if (aad != null) {            for (int i = 0, n = aad.getRelationshipCount(); i < n; i++) {                RelationshipData rd = aad.getRelationship(i);                preexistingItems.add(rd);            }        }        ComponentData[] children = data.getChildren();        for (int i = 0; i < children.length; i++) {            setPreexistingItems(children[i]);        }    }