Package y.base

Examples of y.base.EdgeMap


     */
    public List<Edge> reinsertLowLevelEdges(Node node) {
        List<Edge> reinsertedLowEdges = new ArrayList<Edge>();

        // attention - node and edge maps are all stored in the root graph
        EdgeMap aggregatedEdgeMap = getAggregatedEdgeMap();

        List<Edge> inOutEdges = getInOutEdges(node);
        for (Edge edge : inOutEdges) {
            List<Edge> lowLevelEdges = fGraph.getLowLevelEdges(edge);
            if (lowLevelEdges != null && lowLevelEdges.size() > 0) {
                for (Edge lowLevelEdge : lowLevelEdges) {
                    Edge reinsertedEdge = fGraph.reinsertLowLevelEdge(lowLevelEdge);
                    if (reinsertedEdge != null) {
                        reinsertedLowEdges.add(reinsertedEdge);
                    } else {
                        sLogger.error("Could not get association of low level edge " + lowLevelEdge);
                    }
                }

                // remove higher level edge from edge map and from graph
                aggregatedEdgeMap.set(edge, null);
                getRootGraph().removeEdge(edge);
            } else {
                reinsertedLowEdges.add(edge);
            }
        }
View Full Code Here


     *
     * @return a list with the created higher level edges
     */
    private List<Edge> createHighLevelEdges(Map<MultiKey, List<Edge>> nodePairToEdgeMap, String edgeType) {
        // use the second edge map to store aggregated edges
        EdgeMap aggregatedToContainedEdges = getAggregatedEdgeMap();
        List<Edge> addedHighLevelEdges = new ArrayList<Edge>();

        for (Entry<MultiKey, List<Edge>> entry : nodePairToEdgeMap.entrySet()) {
            Node source = (Node) entry.getKey().getKey(0);
            Node target = (Node) entry.getKey().getKey(1);

            List<Edge> lowLevelEdges = entry.getValue();
            // insert a new edge with the strength corr. to the number of
            // aggregated edges
            Edge highLevelEdge = getHierarchyManager().createEdge(source, target);
            addedHighLevelEdges.add(highLevelEdge);
            aggregatedToContainedEdges.set(highLevelEdge, lowLevelEdges);

            for (Edge lowLevelEdge : lowLevelEdges) {
                try {
                    getRootGraph().removeEdge(lowLevelEdge);
                } catch (IllegalArgumentException iae) {
View Full Code Here

TOP

Related Classes of y.base.EdgeMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.