private fun loadVerticesAndRelatives() { val elementList: MutableList<CnATreeElement> = LinkedList<CnATreeElement>() for (loader in getLoaderList()) { loader.setCnaTreeElementDao(getCnaTreeElementDao()) elementList.addAll(loader.loadElements()) } for (element in elementList) { graph.addVertex(element) if (LOG.isDebugEnabled()) { LOG.debug("Vertex added: " + element.getTitle()) } uuidMap.put(element.getUuid(), element) } for (parent in elementList) { val children: Set<CnATreeElement> = parent.getChildren() for (child in children) { createParentChildEdge(parent, child) } } }
Loads all vertices and adds them to the graph . An edge for each children is added if the child is part of the graph .