Class LineIntersectionList<E>

  • Type Parameters:
    E - The type of intersection members contained in the list
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Intersection<E>>, java.util.Collection<Intersection<E>>, java.util.Deque<Intersection<E>>, java.util.List<Intersection<E>>, java.util.Queue<Intersection<E>>

    public class LineIntersectionList<E>
    extends java.util.LinkedList<Intersection<E>>
    A list implementation that stores intersection across a line and facilitates sorting and finding those intersections
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      LineIntersectionList​(E element, JGeometry line, double tolerance)
      Allocates a new line intersection list
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(Intersection<E> intersection)  
      Intersection<E> findIntersection​(java.awt.geom.Point2D point)
      Looks for an intersection taking place at the given line's point
      Intersection<E> findIntersection​(oracle.sdovis.edit.util.JGeometrySegmentPoint segPoint)
      Looks for an intersection taking place at the given line's segment point
      E getElement()
      Gets the element represented by the line
      JGeometry getLine()
      Gets the current line geometry
      double getTolerance()
      Gets the tolerance used to determine if two points can be considered the same point
      • Methods inherited from class java.util.LinkedList

        add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
      • Methods inherited from class java.util.AbstractSequentialList

        iterator
      • Methods inherited from class java.util.AbstractList

        equals, hashCode, listIterator, removeRange, subList
      • Methods inherited from class java.util.AbstractCollection

        containsAll, isEmpty, removeAll, retainAll, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.util.Deque

        iterator
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
    • Constructor Detail

      • LineIntersectionList

        public LineIntersectionList​(E element,
                                    JGeometry line,
                                    double tolerance)
        Allocates a new line intersection list
        Parameters:
        element - the element represented by the line
        line - the line where the intersections take place
        tolerance - the tolerance used to determine if a two points are the same point
    • Method Detail

      • findIntersection

        public Intersection<E> findIntersection​(java.awt.geom.Point2D point)
        Looks for an intersection taking place at the given line's point
        Parameters:
        point - a point in the line
        Returns:
        an intersection if it was found
      • getElement

        public E getElement()
        Gets the element represented by the line
        Returns:
        an element owner of the line
      • getLine

        public JGeometry getLine()
        Gets the current line geometry
        Returns:
        a line string geometry
      • getTolerance

        public double getTolerance()
        Gets the tolerance used to determine if two points can be considered the same point
        Returns:
        a tolerance value
      • findIntersection

        public Intersection<E> findIntersection​(oracle.sdovis.edit.util.JGeometrySegmentPoint segPoint)
        Looks for an intersection taking place at the given line's segment point
        Parameters:
        segPoint - a line's segment point
        Returns:
        an intersection if some was found
      • add

        public boolean add​(Intersection<E> intersection)
        Specified by:
        add in interface java.util.Collection<E>
        Specified by:
        add in interface java.util.Deque<E>
        Specified by:
        add in interface java.util.List<E>
        Specified by:
        add in interface java.util.Queue<E>
        Overrides:
        add in class java.util.LinkedList<Intersection<E>>