Class VertexImpl

    • Field Detail

      • id

        protected long id
        Unique internal identifier
      • externalId

        protected String externalId
        External identifier used in input files
      • inputProperties

        protected Map<String,​Object> inputProperties
        generic input property storage
      • position

        protected org.locationtech.jts.geom.Point position
        Position of the vertex
      • edges

        protected final Map<Long,​Edge> edges
        Edges of this vertex
    • Constructor Detail

      • VertexImpl

        protected VertexImpl​(IdGroupingToken groupId)
        Constructor
        Parameters:
        groupId - , contiguous id generation within this group for instances of this class
      • VertexImpl

        protected VertexImpl​(VertexImpl vertexImpl)
        Copy constructor (for now input properties are NOT copied, because a shallow copy of contents is dangerous). Geometry is deep copied, edges are not because they are not owned by the vertex.
        Parameters:
        vertexImpl - to copy
    • Method Detail

      • generateVertexId

        protected static long generateVertexId​(IdGroupingToken groupId)
        generate unique node id
        Parameters:
        groupId - , contiguous id generation within this group for instances of this class
        Returns:
        nodeId
      • setId

        protected void setId​(Long id)
        Set id on vertex
        Parameters:
        id - to set
      • getPosition

        public org.locationtech.jts.geom.Point getPosition()
        #Collect the geometry of the point location of this vertex
        Specified by:
        getPosition in interface Vertex
        Returns:
        direct position reflecting point location
      • setPosition

        public void setPosition​(org.locationtech.jts.geom.Point position)
        #Set the center point geometry for a vertex
        Specified by:
        setPosition in interface Vertex
        Parameters:
        position - the center point for a vertex
      • getId

        public long getId()
        #collect id of the entity
        Specified by:
        getId in interface Idable
        Returns:
        id
      • setExternalId

        public void setExternalId​(String externalId)
        set the external id
        Specified by:
        setExternalId in interface ExternalIdable
        Parameters:
        externalId - to set
      • getXmlId

        public String getXmlId()
        the id exposed to users as the "normal" id in the PLANit native xml format
        Specified by:
        getXmlId in interface ExternalIdable
        Returns:
        xmlId
      • setXmlId

        public void setXmlId​(String xmlId)
        set the external id
        Specified by:
        setXmlId in interface ExternalIdable
        Parameters:
        xmlId - to set
      • addInputProperty

        public void addInputProperty​(String key,
                                     Object value)
        Add a property from the original input that is not part of the readily available members
        Specified by:
        addInputProperty in interface Vertex
        Parameters:
        key - key (name) of the input property
        value - value of the input property
      • getInputProperty

        public Object getInputProperty​(String key)
        Get input property by its key
        Parameters:
        key - the key of the input property
        Returns:
        value the value of the input property
      • addEdge

        public boolean addEdge​(Edge edge)
        Add edge, do not invoke when parsing networks, this connection is auto-populated before the assignment starts based on the edge and its two vertices that have been registered.
        Specified by:
        addEdge in interface Vertex
        Parameters:
        edge - Edge to be added
        Returns:
        true when added, false when already present (and not added)
      • removeEdge

        public boolean removeEdge​(Edge edge)
        Remove edge
        Specified by:
        removeEdge in interface Vertex
        Parameters:
        edge - Edge to be removed
        Returns:
        true when removed, false when not present (and not removed)
      • removeEdge

        public boolean removeEdge​(long edgeId)
        Description copied from interface: Vertex
        Remove edge
        Specified by:
        removeEdge in interface Vertex
        Parameters:
        edgeId - Edge to be removed
        Returns:
        true when removed, false when not present (and not removed)
      • getEdges

        public Collection<Edge> getEdges()
        Returns a collection of Edge objects
        Specified by:
        getEdges in interface Vertex
        Returns:
        Set of Edge objects
      • getNumberOfEdges

        public int getNumberOfEdges()
        Number of entries in edge segments
        Specified by:
        getNumberOfEdges in interface Vertex
        Returns:
        the number of edges connected to this vertex
      • getEdges

        public Set<Edge> getEdges​(Vertex otherVertex)
        colect the edge(s) based on the other vertex
        Specified by:
        getEdges in interface Vertex
        Parameters:
        otherVertex - that defines the edge(s)
        Returns:
        edges for which this holds, if none hold an empty set is returned
      • validate

        public boolean validate()
        validate the vertex regarding it connections to edges etc.
        Specified by:
        validate in interface Vertex
        Returns:
        true when valid, false otherwise