ParamAVLIterator<AbstractEdge> edgeIterator = new ParamAVLIterator<AbstractEdge>();
for (TreeListIterator itr = new TreeListIterator(treeStructure.getTree(), 1); itr.hasNext();) {
AbstractNode node = itr.next();
for (edgeIterator.setNode(node.getEdgesOutTree()); edgeIterator.hasNext();) {
AbstractEdge edge = edgeIterator.next();
if (edge.isSelfLoop()) {
writer.writeStartElement(ELEMENT_EDGES_SELFLOOP);
} else if (edge.isMixed()) {
writer.writeStartElement(ELEMENT_EDGES_MIXED);
writer.writeAttribute("directed", String.valueOf(edge.isDirected()));
} else {
writer.writeStartElement(ELEMENT_EDGES_PROPER);
}
writer.writeAttribute("source", String.valueOf(edge.getSource().pre));
writer.writeAttribute("target", String.valueOf(edge.getTarget().pre));
writer.writeAttribute("weight", String.valueOf(edge.getWeight()));
writer.writeAttribute("id", String.valueOf(edge.getId()));
writer.writeEndElement();
}
}
writer.writeEndElement();