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)
        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
      • LinkImpl

        protected LinkImpl​(IdGroupingToken groupId,
                           Node nodeA,
                           Node nodeB,
                           double length)
        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
    • Method Detail

      • generateLinkId

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

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

        protected long recreateLinkId​(IdGroupingToken tokenId)
        recreate the internal link id and set it
        Parameters:
        tokenId - to use
        Returns:
        the created link id
      • 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
      • 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