Class FastSegmentSetIntersectionFinder


  • public class FastSegmentSetIntersectionFinder
    extends java.lang.Object
    Finds if two sets of SegmentStrings intersect. Uses indexing for fast performance and to optimize repeated tests against a target set of lines. Short-circuited to return as soon an intersection is found. Immutable and thread-safe.
    Version:
    1.7
    • Constructor Detail

      • FastSegmentSetIntersectionFinder

        public FastSegmentSetIntersectionFinder​(java.util.Collection baseSegStrings)
        Creates an intersection finder against a given set of segment strings.
        Parameters:
        baseSegStrings - the segment strings to search for intersections
    • Method Detail

      • getSegmentSetIntersector

        public SegmentSetMutualIntersector getSegmentSetIntersector()
        Gets the segment set intersector used by this class. This allows other uses of the same underlying indexed structure.
        Returns:
        the segment set intersector used
      • intersects

        public boolean intersects​(java.util.Collection segStrings)
        Tests for intersections with a given set of target SegmentStrings.
        Parameters:
        segStrings - the SegmentStrings to test
        Returns:
        true if an intersection is found
      • intersects

        public boolean intersects​(java.util.Collection segStrings,
                                  SegmentIntersectionDetector intDetector)
        Tests for intersections with a given set of target SegmentStrings. using a given SegmentIntersectionDetector.
        Parameters:
        segStrings - the SegmentStrings to test
        intDetector - the intersection detector to use
        Returns:
        true if the detector reports intersections