Class IntersectionMember<V>

  • Type Parameters:
    V - The type of the intersection member
    All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    LineIntersectionMember, PointIntersectionMember

    public abstract class IntersectionMember<V>
    extends java.lang.Object
    implements java.lang.Cloneable
    Holds the information of an element participating in an intersection interaction along with the information of how the element is intersected.
    • Field Detail

      • id

        protected long id
      • element

        protected V element
      • distToComInterPoint

        protected double distToComInterPoint
    • Constructor Detail

      • IntersectionMember

        public IntersectionMember​(V element,
                                  JGeometry geometry)
        Allocates a new intersection member
        Parameters:
        element - the element participating in the intersection
        geometry - the element's geometry
    • Method Detail

      • getNextId

        protected static long getNextId()
      • getId

        public long getId()
        Gets the member's id
        Returns:
        the member's id
      • getElement

        public V getElement()
        Gets the intersection's element
        Returns:
        the intersection's element
      • setElement

        public void setElement​(V element)
        Sets the intersection's element
        Parameters:
        element - the intersection's element
      • getGeometry

        public JGeometry getGeometry()
        Gets the geometry of the intersection's element
        Returns:
        the geometry of the intersection's element
      • setGeometry

        public void setGeometry​(JGeometry geometry)
        Sets the geometry of the intersection's element
        Parameters:
        geometry - the geometry of the intersection's element
      • getIntersectionLocation

        public IntersectionLocation getIntersectionLocation()
        Gets the element's location where the intersection takes place
        Returns:
        an intersection location type
      • setIntersectionLocation

        public void setIntersectionLocation​(IntersectionLocation intersectionLocation)
        Sets the element's location where the intersection takes place
        Parameters:
        intersectionLocation - an intersection location type
      • getDistToInterCommonPoint

        public double getDistToInterCommonPoint()
        Gets the distance from the element's intersected point to the point considered as the origin of the intersection
        Returns:
        the distance to the intersection common point
      • setDistToInterCommonPoint

        public void setDistToInterCommonPoint​(double distToComInterPoint)
        Sets the distance from the element's intersected point to the point considered as the origin of the intersection
        Parameters:
        distToComInterPoint - the distance to the intersection's common point
      • isLine

        public abstract boolean isLine()
        Tells whether the element held is a line
        Returns:
        true if the element is a line
      • isPoint

        public abstract boolean isPoint()
        Tells whether the element held is a point
        Returns:
        true if the element is a point
      • getIntersectionPoint

        public abstract java.awt.geom.Point2D getIntersectionPoint()
        Gets the spatial point where the element is intersected.
        Returns:
        a java point
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Overrides:
        clone in class java.lang.Object
        Throws:
        java.lang.CloneNotSupportedException