Class GraphIterationElementComparator<ST extends GraphSegment<ST,​PT>,​PT extends GraphPoint<PT,​ST>>

    • Constructor Detail

      • GraphIterationElementComparator

        public GraphIterationElementComparator​(boolean assumeOrientedSegments1)
        Constructor.
        Parameters:
        assumeOrientedSegments1 - may be true to assume that the same segment has two different instances for graph iteration: the first instance is associated the first point of the segment and the second instance is associated to the last point of the segment. If this parameter is false to assume that the end points of a segment are not distinguished.
    • Method Detail

      • compareSegments

        @Pure
        protected int compareSegments​(ST s1,
                                      ST s2)
        Compare the two given segments.
        Parameters:
        s1 - the first segment.
        s2 - the second segment.
        Returns:
        -1 if s1 is lower than s2, 1 if s1 is greater than s2, otherwise 0.
      • compareConnections

        @Pure
        protected int compareConnections​(PT p1,
                                         PT p2)
        Compare the two given entry points.
        Parameters:
        p1 - the first connection.
        p2 - the second connection.
        Returns:
        -1 if p1 is lower than p2, 1 if p1 is greater than p2, otherwise 0.
      • isOrientedSegments

        @Pure
        public boolean isOrientedSegments()
        Replies if this comparator is assuming that segments are oriented.
        Returns:
        true if segments are oriented, otherwise false