Interface IWay<N extends INode>

Type Parameters:
N - type of OSM node
All Superinterfaces:
Comparable<IPrimitive>, IPrimitive, IQuadBucketType, PrimitiveId, Stylable, Tagged
All Known Implementing Classes:
VectorWay, Way, WayData

public interface IWay<N extends INode> extends IPrimitive
IWay captures the common functions of Way and WayData.
Since:
4098
  • Method Details

    • 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:
    • getNode

      N getNode(int index)
      Replies the node at position index.
      Parameters:
      index - the position
      Returns:
      the node at position index
      Throws:
      ArrayIndexOutOfBoundsException - if index < 0 or index >= getNodesCount()
      Since:
      1862, 13717 (IWay)
    • getNodes

      Returns the list of nodes in this way.
      Returns:
      the list of nodes in this way
      Since:
      1862, 13717 (IWay)
    • getChildren

      default List<N> getChildren()
      Description copied from interface: IPrimitive
      Get child primitives that are referred by this primitive. Relation: Members of the relation Way: Nodes used by the way Node: None
      Specified by:
      getChildren in interface IPrimitive
      Returns:
      List of child primitives
    • getNodeIds

      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
    • compareTo

      default int compareTo(IPrimitive o)
      Specified by:
      compareTo in interface Comparable<N extends INode>
    • getDisplayName

      default String getDisplayName(NameFormatter formatter)
      Description copied from interface: IPrimitive
      Replies the display name of a primitive formatted by formatter
      Specified by:
      getDisplayName in interface IPrimitive
      Parameters:
      formatter - formatter to use
      Returns:
      the display name
    • firstNode

      Returns the first node of this way. The result equals getNode(0).
      Returns:
      the first node of this way
      Since:
      13922
    • 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