Class OSMWay

java.lang.Object
org.opentrafficsim.road.network.factory.osm.OSMWay
All Implemented Interfaces:
java.io.Serializable

public class OSMWay
extends java.lang.Object
implements java.io.Serializable
OSMWay wraps an ordered set of OSMNode (identified by their ids) and a list of tags.

Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

$LastChangedDate: 2015-07-26 01:01:13 +0200 (Sun, 26 Jul 2015) $, @version $Revision: 1155 $, by $Author: averbraeck $, initial version 31 dec. 2014

Author:
Moritz Bergmann
See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    OSMWay​(long id)
    Construct a new OSMWay.
  • Method Summary

    Modifier and Type Method Description
    void addTag​(OSMTag waytag)
    Add one tag to the list of tags of this OSMWay.
    void appendNode​(java.lang.Long nodeId)
    Append one node id to the list of node ids.
    long getId()
    Retrieve the dd of this OSMWay.
    java.util.List<OSMTag> getMatchingTags​(java.lang.String tagKey)
    Retrieve the tags that match the give key.
    java.util.List<java.lang.Long> getNodes()
    Retrieve the list of ids that comprise this OSMWay.
    java.util.List<OSMTag> getTags()
    Retrieve the list of OSMTags of this OSMWay.
    void setNodes​(java.util.List<java.lang.Long> newNodes)
    Set/replace the list of way nodes.
    void setTags​(java.util.List<OSMTag> newTags)
    Set/replace the list of way tags.
    java.lang.String toString()

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • OSMWay

      public OSMWay​(long id)
      Construct a new OSMWay.
      Parameters:
      id - long; Id of the new OSMWay
  • Method Details

    • getId

      public final long getId()
      Retrieve the dd of this OSMWay.
      Returns:
      long; the id of this OSMWay
    • getNodes

      public final java.util.List<java.lang.Long> getNodes()
      Retrieve the list of ids that comprise this OSMWay.
      Returns:
      List<Long>; a list of ids of the nodes of this OSMWay DO NOT MODIFY THE RESUL.
    • setNodes

      public final void setNodes​(java.util.List<java.lang.Long> newNodes)
      Set/replace the list of way nodes.
      Parameters:
      newNodes - List<Long>; the new list of way nodes
    • appendNode

      public final void appendNode​(java.lang.Long nodeId)
      Append one node id to the list of node ids.
      Parameters:
      nodeId - Long; the id of the node that must be added
    • getTags

      public final java.util.List<OSMTag> getTags()
      Retrieve the list of OSMTags of this OSMWay.
      Returns:
      List<OSMTab>; the list of OSMTags of this OSMWay (modifications on this result are reflected in this OSMWay)
    • setTags

      public final void setTags​(java.util.List<OSMTag> newTags)
      Set/replace the list of way tags.
      Parameters:
      newTags - List<OSMTag>; the new list of way tags
    • addTag

      public final void addTag​(OSMTag waytag)
      Add one tag to the list of tags of this OSMWay.
      Parameters:
      waytag - OSMTag; the tag that must be added
    • getMatchingTags

      public final java.util.List<OSMTag> getMatchingTags​(java.lang.String tagKey)
      Retrieve the tags that match the give key.
      Parameters:
      tagKey - String; the key
      Returns:
      List of matching Tags; the returned list is a copy; modifications of the result do not affect this OSMWay
    • toString

      public final java.lang.String toString()
      Overrides:
      toString in class java.lang.Object