Interface Vertex

    • Field Detail

      • LOGGER

        static final Logger LOGGER
        vertex logger
      • VERTEX_ID_CLASS

        static final Class<Vertex> VERTEX_ID_CLASS
        id class for generating ids
    • Method Detail

      • addInputProperty

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

        Object getInputProperty​(String key)
        collect a property
        Parameters:
        key - for the property
        Returns:
        property itself
      • setPosition

        void setPosition​(org.locationtech.jts.geom.Point position)
        Set the center point geometry for a vertex
        Parameters:
        position - the center point for a vertex
      • getPosition

        org.locationtech.jts.geom.Point getPosition()
        Collect the geometry of the point location of this vertex
        Returns:
        direct position reflecting point location
      • addEdge

        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.
        Parameters:
        edge - Edge to be added
        Returns:
        true when added, false when already present (and not added)
      • addEdges

        default void addEdges​(Collection<? extends Edge> toBeAdded)
        Add multiple edges at the same time
        Parameters:
        toBeAdded - the to be added edges
      • removeEdge

        boolean removeEdge​(long edgeId)
        Remove edge
        Parameters:
        edgeId - Edge to be removed
        Returns:
        true when removed, false when not present (and not removed)
      • getEdges

        Collection<? extends Edge> getEdges()
        Returns a collection of Edge objects (unmodifiable)
        Returns:
        Set of Edge objects
      • getIdClass

        default Class<? extends Vertex> getIdClass()
        All vertices use the VERTEX_ID_CLASS to generate the unique internal ids
        Specified by:
        getIdClass in interface ManagedId
        Returns:
        idClass to use for generating ids for instances of this idable derived class
      • hasPosition

        default boolean hasPosition()
        Verify if position is available
        Returns:
        true when available, false otherwise
      • removeEdge

        default boolean removeEdge​(Edge edge)
        Remove edge
        Parameters:
        edge - Edge to be removed
        Returns:
        true when removed, false when not present (and not removed)
      • removeEdges

        default void removeEdges​(Collection<? extends Edge> toBeRemoved)
        Remove provided edges
        Parameters:
        toBeRemoved - to remove
      • removeAllEdges

        void removeAllEdges()
        Remove al edges from vertex
      • getEdges

        default Set<? extends Edge> getEdges​(Vertex otherVertex)
        Collect the edge(s) based on the other vertex
        Parameters:
        otherVertex - that defines the edge(s)
        Returns:
        edges for which this holds, if none hold an empty set is returned
      • getNumberOfEdges

        default int getNumberOfEdges()
        Number of entries in edge segments
        Returns:
        the number of edges connected to this vertex
      • replace

        default boolean replace​(Edge edgeToReplace,
                                Edge edgeToReplaceWith,
                                boolean forceInsert)
        replace one edge with the other
        Parameters:
        edgeToReplace - one to replace
        edgeToReplaceWith - one to replace it with
        forceInsert - when true the replacement will be added even if original cannot be found, when false not
        Returns:
        successful replacement/insert when true, false otherwise
      • transformPosition

        default void transformPosition​(org.opengis.referencing.operation.MathTransform transformer)
                                throws org.opengis.geometry.MismatchedDimensionException,
                                       org.opengis.referencing.operation.TransformException
        transform the position information of this vertex using the passed in MathTransform
        Parameters:
        transformer - to apply
        Throws:
        org.opengis.geometry.MismatchedDimensionException - thrown if error
        org.opengis.referencing.operation.TransformException - thrown if error
      • isPositionEqual2D

        default boolean isPositionEqual2D​(org.locationtech.jts.geom.Coordinate coordinate)
        Verify if the vertex position is exactly equal (in 2D) to the passed in coordinate
        Parameters:
        coordinate - to check against
        Returns:
        true when equal location in 2D, false otherwise
      • isPositionEqual2D

        default boolean isPositionEqual2D​(org.locationtech.jts.geom.Coordinate coordinate,
                                          double epsilon)
        Verify if the vertex position is exactly equal (in 2D) to the passed in coordinate
        Parameters:
        coordinate - to check against
        epsilon - allowed difference to still be regarded equal
        Returns:
        true when equal location in 2D, false otherwise
      • validate

        default boolean validate()
        Validate the vertex regarding it connections to edges etc.
        Returns:
        true when valid, false otherwise