Class EdgeUtils


  • public class EdgeUtils
    extends Object
    Utilities for edges that do not belong within the Edge class itself
    • Constructor Detail

      • EdgeUtils

        public EdgeUtils()
    • Method Detail

      • getSharedVertex

        public static Vertex getSharedVertex​(Edge edge1,
                                             Edge edge2)
        Collect shared vertex between two edges if any exists
        Parameters:
        edge1 - to check
        edge2 - to check
        Returns:
        shared vertex, null if none is found
      • updateEdgeVertices

        public static <E extends Edge,​V extends Vertex> void updateEdgeVertices​(Iterable<E> edges,
                                                                                      Function<V,​V> vertexToVertexMapping,
                                                                                      boolean replaceMissingMappings)
        Update the vertices of all edges based on the mapping provided. If no mapping exists, the edge will be assigned a null reference, unless indicated otherwise
        Type Parameters:
        E - type of edge
        V - type of vertex
        Parameters:
        edges - to update vertices for
        vertexToVertexMapping - to use should contain original vertex as currently used on edge and then the value is the new vertex to replace it
        replaceMissingMappings - when true missing mappings results in a null assignment, otherwise they are left in-tact