public class OSMLink extends Object implements Serializable, Identifiable
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
Constructor and Description |
---|
OSMLink(OSMNode startNode,
OSMNode endNode,
List<OSMTag> tags,
double length,
byte lanes,
byte flanes)
Construct a new OSMLink with specified number of lanes and forward lanes.
|
OSMLink(OSMNode fromNode,
OSMNode toNode,
List<OSMTag> tags,
double length,
WarningListener warningListener)
Construct a new OSMLink.
|
Modifier and Type | Method and Description |
---|---|
void |
addSpline(OSMNode shapeNode)
Append a Node to the list of OSMNodes of this OSMLink that define the shape of this OSMLink.
|
void |
addTag(OSMTag tag)
Add an OSMTag to this Link.
|
boolean |
containsAllTags(List<OSMTag> tagsToCheck)
Report if this OSMLink has all tags in a supplied set.
|
OSMNode |
getEnd() |
byte |
getForwardLanes()
Retrieve the total number of forward lanes on this OSMLink; forward lanes are lanes that may only be traveled from
startNode towards endNode.
|
String |
getId() |
byte |
getLanes()
Retrieve the total number of lanes on this OSMLink.
|
double |
getLength()
Retrieve the length of this OSMLink.
|
List<OSMNode> |
getSplineList()
Retrieve the list of OSMNodes that define the shape of this OSMLink.
|
OSMNode |
getStart() |
List<OSMTag> |
getTags()
Retrieve the tags of this OSMLink.
|
boolean |
hasTag(String key)
Returns true if the link has an OSMTag with the specified key.
|
boolean |
isOneway()
Indicate if this OSMLink is one way.
|
void |
setOneway(boolean isOneWay)
Set the one way status of this OSMLink.
|
String |
toString() |
public OSMLink(OSMNode fromNode, OSMNode toNode, List<OSMTag> tags, double length, WarningListener warningListener)
fromNode
- OSMNode; the OSMNode where this OSMLinks beginstoNode
- OSMNode; the OSMNode where this OSMLink endstags
- List<OSMTag>; the OSMTags (inherited from the OSMWay that causes this OSMLink to be constructed)length
- double; the length of the new OSMLinkwarningListener
- WarningListener; the warning listener that will receive warning eventspublic OSMLink(OSMNode startNode, OSMNode endNode, List<OSMTag> tags, double length, byte lanes, byte flanes)
startNode
- OSMNode; the start OSMNode of the new OSMLinkendNode
- OSMNode; the end OSMNode of the new OSMLinktags
- List<OSMTag>; List of Tags inherited from waylength
- double; length of linklanes
- byte; the total number of lanesflanes
- byte; the number of forward lanespublic final String getId()
getId
in interface Identifiable
public final OSMNode getStart()
public final OSMNode getEnd()
public final List<OSMTag> getTags()
public final boolean isOneway()
public final void setOneway(boolean isOneWay)
isOneWay
- boolean; the new value for the one way status of this OSMLinkpublic final byte getLanes()
public final byte getForwardLanes()
public final void addTag(OSMTag tag)
tag
- OSMTag; the OSMTag that must be addedpublic final double getLength()
public final List<OSMNode> getSplineList()
public final void addSpline(OSMNode shapeNode)
shapeNode
- OSMNode; the OSMNode to add to the list of OSMNodes that define the shape of this OSMLinkpublic final boolean hasTag(String key)
key
- String; the key of the sought OSMTagCopyright © 2014–2019 Delft University of Technology. All rights reserved.