Interface IWay<N extends INode>

    • Method Detail

      • getNodesCount

        int getNodesCount()
        Replies the number of nodes in this way.
        Returns:
        the number of nodes in this way.
      • isEmpty

        default boolean isEmpty()
        Determines if this way is empty, i.e. it has no nodes.
        Returns:
        true if this way is empty, i.e. it has no nodes
        Since:
        16119
      • getRealNodesCount

        default int getRealNodesCount()
        Replies the real number of nodes in this way (full number of nodes minus one if this way is closed)
        Returns:
        the real number of nodes in this way.
        Since:
        5847, 13564 (IWay)
        See Also:
        getNodesCount(), isClosed()
      • getNodes

        List<NgetNodes()
        Returns the list of nodes in this way.
        Returns:
        the list of nodes in this way
        Since:
        1862, 13717 (IWay)
      • getNodeIds

        List<LonggetNodeIds()
        Returns the list of node ids in this way.
        Returns:
        the list of node ids in this way
        Since:
        13717
      • getNodeId

        long getNodeId​(int idx)
        Returns id of the node at given index.
        Parameters:
        idx - node index
        Returns:
        id of the node at given index
      • setNodes

        void setNodes​(List<N> nodes)
        Set new list of nodes to way. This method is preferred to multiple calls to addNode/removeNode and similar methods because nodes are internally saved as array which means lower memory overhead but also slower modifying operations.
        Parameters:
        nodes - New way nodes. Can be null, in that case all way nodes are removed
      • isClosed

        boolean isClosed()
        Determines if this way is closed.
        Returns:
        true if this way is closed, false otherwise
      • firstNode

        N firstNode()
        Returns the first node of this way. The result equals getNode(0).
        Returns:
        the first node of this way
        Since:
        13922
      • lastNode

        N lastNode()
        Returns the last node of this way. The result equals getNode(getNodesCount - 1).
        Returns:
        the last node of this way
        Since:
        13922
      • isFirstLastNode

        boolean isFirstLastNode​(INode n)
        Replies true if the given node is the first or the last one of this way, false otherwise.
        Parameters:
        n - The node to test
        Returns:
        true if the n is the first or the last node, false otherwise.
        Since:
        13922
      • isInnerNode

        boolean isInnerNode​(INode n)
        Replies true if the given node is an inner node of this way, false otherwise.
        Parameters:
        n - The node to test
        Returns:
        true if the n is an inner node, false otherwise.
        Since:
        13922
      • hasIncompleteNodes

        default boolean hasIncompleteNodes()
        Replies true if this way has incomplete nodes, false otherwise.
        Returns:
        true if this way has incomplete nodes, false otherwise.
        Since:
        18019