public class Road extends Object
Constructor and Description |
---|
Road(String name,
BasicMap map)
Create a new Road with no Lanes.
|
Road(String name,
List<Lane> lanes,
BasicMap map)
Create a new Road with the given Lanes, ordered from left to right.
|
Modifier and Type | Method and Description |
---|---|
void |
addTheRightMostLane(Lane lane)
Add a right most lane to this Road.
|
Road |
getDual()
Get the Road that follows this Road in the opposite direction.
|
Lane |
getIndexLane()
Get the leftmost Lane in this Road.
|
List<Lane> |
getLanes()
Get the Lanes that make up this Road, in order from left to right.
|
double |
getMaximumConnectedSpeedLimit()
Get the maximum speed limit of any connected road.
|
String |
getName()
Get the name of this Road.
|
boolean |
hasDual()
Whether or not this Road has a dual.
|
void |
setDual(Road dual)
Set the Road that follows this Road in the opposite direction.
|
String |
toString()
Get the name of this Road.
|
public Road(String name, BasicMap map)
name
- the name of the Roadmap
- the map of which the Road is a partpublic double getMaximumConnectedSpeedLimit()
public List<Lane> getLanes()
public Lane getIndexLane()
public Road getDual()
public void setDual(Road dual)
dual
- the Road that follows this Road in the opposite directionpublic boolean hasDual()
public void addTheRightMostLane(Lane lane)
lane
- the Lane to addpublic String getName()
Copyright © 2013. All rights reserved.