Class VertexImpl<E extends Edge>

    • Field Detail

      • 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 ArrayList<E extends Edge> edges
        Edges of this vertex. List used to ensure fixed order in iterating and minimal memory overhead
    • Constructor Detail

      • VertexImpl

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

        protected VertexImpl​(IdGroupingToken groupId,
                             Class<? extends Vertex> vertexIdClass)
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        vertexIdClass - to use
      • VertexImpl

        protected VertexImpl​(long id)
        Constructor. Only to be used when not reliant on contiguous id generation within enclosing container
        Parameters:
        id - to use
      • VertexImpl

        protected VertexImpl​(VertexImpl<E> other,
                             boolean deepCopy)
        Copy constructor.
        Parameters:
        other - to copy
        deepCopy - when true, create a deep copy, shallow copy otherwise
    • Method Detail

      • 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
      • 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)
        collect a property
        Specified by:
        getInputProperty in interface Vertex
        Parameters:
        key - for the property
        Returns:
        property itself
      • 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​(long edgeId)
        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)
      • removeAllEdges

        public void removeAllEdges()
        Remove al edges from vertex
        Specified by:
        removeAllEdges in interface Vertex
      • getEdges

        public Collection<? extends E> getEdges()
        Returns a collection of Edge objects (unmodifiable)
        Specified by:
        getEdges in interface Vertex
        Returns:
        Set of Edge objects
      • deepClone

        public VertexImpl<E> deepClone()
        An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code
        Specified by:
        deepClone in interface GraphEntity
        Specified by:
        deepClone in interface IdAble
        Specified by:
        deepClone in interface Vertex
        Specified by:
        deepClone in class GraphEntityImpl
        Returns:
        deep copy of entity