public class RelativeLane extends Object implements Comparable<RelativeLane>, Serializable
Copyright (c) 2013-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Field and Description |
---|---|
static RelativeLane |
CURRENT
Current lane.
|
static RelativeLane |
LEFT
Left lane.
|
static RelativeLane |
RIGHT
right lane.
|
static RelativeLane |
SECOND_LEFT
Second left lane.
|
static RelativeLane |
SECOND_RIGHT
Second right lane.
|
Constructor and Description |
---|
RelativeLane(org.opentrafficsim.core.network.LateralDirectionality lat,
int numLanes)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
RelativeLane |
add(RelativeLane relativeLane)
Returns the relative lane relative to this lane, for example "the left lane" of "the 3rd right lane" is "the 2nd right
lane".
|
int |
compareTo(RelativeLane rel) |
boolean |
equals(Object obj) |
org.opentrafficsim.core.network.LateralDirectionality |
getLateralDirectionality()
Returns the lateral direction.
|
RelativeLane |
getLeft()
Returns the left hand relative lane of this relative lane.
|
int |
getNumLanes()
Returns the number of lanes in the lateral direction.
|
RelativeLane |
getRight()
Returns the right hand relative lane of this relative lane.
|
int |
hashCode() |
boolean |
isCurrent()
Returns whether the current lane is referred to.
|
boolean |
isLeft()
Returns whether the left lane is referred to.
|
boolean |
isRight()
Returns whether the right lane is referred to.
|
boolean |
isSecondLeft()
Returns whether the second left lane is referred to.
|
boolean |
isSecondRight()
Returns whether the second right lane is referred to.
|
String |
toString() |
public static final RelativeLane SECOND_LEFT
public static final RelativeLane LEFT
public static final RelativeLane CURRENT
public static final RelativeLane RIGHT
public static final RelativeLane SECOND_RIGHT
public RelativeLane(org.opentrafficsim.core.network.LateralDirectionality lat, int numLanes)
lat
- lateral direction (use null
for the current lane)numLanes
- number of lanes in the lateral direction (not important for the current lane)IllegalArgumentException
- if numLanes is not at least 1, except if lat == null
(current lane)IllegalArgumentException
- if numLanes is not 0 if lat == null
(current lane)public final org.opentrafficsim.core.network.LateralDirectionality getLateralDirectionality()
public final int getNumLanes()
public final boolean isSecondLeft()
public final boolean isLeft()
public final boolean isCurrent()
public final boolean isRight()
public final boolean isSecondRight()
public final RelativeLane getLeft()
public final RelativeLane getRight()
public final RelativeLane add(RelativeLane relativeLane)
relativeLane
- relative lane to get of this lanepublic final int compareTo(RelativeLane rel)
compareTo
in interface Comparable<RelativeLane>
Copyright © 2014–2017 Delft University of Technology. All rights reserved.