for (Object obj : tempList) {
if (obj instanceof Link) {
result.add((Link) obj);
} else if (obj instanceof AgentSet) {
AgentSet tempSet = (AgentSet) obj;
if (tempSet.type() != org.nlogo.agent.Link.class) {
throw new EngineException(context, this,
I18N.errorsJ().getN("org.nlogo.prim.etc._linkset.invalidLAgentsetTypeInputToList",
this.displayName(), Dump.logoObject(tempList, true, false), Dump.logoObject(obj, true, false)));
}
for (AgentSet.Iterator iter2 = tempSet.iterator();