Class LinkImpl

    • Field Detail

      • linkId

        protected long linkId
        unique internal identifier
    • Constructor Detail

      • LinkImpl

        protected LinkImpl​(LinkImpl linkImpl)
        Copy constructor, geometry is deep copied, see also DirectedEdge copy constructed
        Parameters:
        linkImpl - to copy
      • LinkImpl

        protected LinkImpl​(IdGroupingToken groupId,
                           Node nodeA,
                           Node nodeB,
                           double length)
                    throws PlanItException
        Constructor which injects link length directly
        Parameters:
        groupId - , contiguous id generation within this group for instances of this class
        nodeA - the first node in the link
        nodeB - the second node in the link
        length - the length of the link
        Throws:
        PlanItException - thrown if there is an error
    • Method Detail

      • generateLinkId

        protected static long generateLinkId​(IdGroupingToken groupId)
        generate unique link id
        Parameters:
        groupId - , contiguous id generation within this group for instances of this class
        Returns:
        linkId
      • setLinkId

        protected void setLinkId​(long linkId)
        Set the link id
        Parameters:
        linkId - to set
      • getLinkId

        public long getLinkId()
        Return id of this instance. This id is expected to be generated using the org.planit.utils.misc.IdGenerator
        Specified by:
        getLinkId in interface Link
        Returns:
        linkId
      • clone

        public LinkImpl clone()
        Clone the edge as is, all shared members are shallow copied, fully owned members are deep copied
        Specified by:
        clone in interface Edge
        Overrides:
        clone in class DirectedEdgeImpl
        Returns:
        copy of this edge
      • validate

        public boolean validate()
        validate the contents of this edge
        Specified by:
        validate in interface Edge
        Overrides:
        validate in class EdgeImpl
        Returns:
        true when valid, false otherwise