|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vanetsim.map.Street
public final class Street
A street on the map.
Constructor Summary | |
---|---|
Street(java.lang.String name,
Node startNode,
Node endNode,
java.lang.String streetType,
int oneway,
int lanes,
java.awt.Color displayColor,
Region mainRegion,
int maxSpeed)
Instantiates a new street. |
Method Summary | |
---|---|
void |
addBridgePaintLine(double x1,
double y1,
double x2,
double y2)
Adds a line for painting a bridge. |
void |
addBridgePaintPolygon(double x1,
double y1,
double x2,
double y2,
double x3,
double y3,
double x4,
double y4)
Adds a polygon for painting a bridge. |
void |
addLaneObject(LaneObject object,
boolean direction)
Adds a lane object. |
void |
changeOneWay(int oneway)
Changes if this street is a oneway street or not. |
void |
clearLanes()
Clears all objects from the lanes container. |
void |
delLaneObject(LaneObject object,
boolean direction)
Removes a lane object. |
boolean |
equals(java.lang.Object other)
Checks if this object is equal to another. |
java.util.ArrayList<java.awt.geom.Point2D.Double> |
getBridgePaintLines()
Gets the lines to paint a bridge. |
java.util.ArrayList<java.awt.geom.Point2D.Double> |
getBridgePaintPolygons()
Gets the polygons to paint a bridge. |
java.awt.Color |
getDisplayColor()
Gets the display color of this street. |
Node |
getEndNode()
Gets the end node of this street. |
int |
getEndNodeTrafficLightState()
Gets the state of the traffic light. |
LaneObject |
getFirstLaneObject(boolean direction)
Gets the first lane object. |
int |
getLanesCount()
Gets the amount of lanes in one direction. |
LaneObject |
getLastLaneObject(boolean direction)
Gets the last lane object. |
double |
getLength()
Gets the length of the street. |
Region |
getMainRegion()
Gets the region to which this street is primarily assigned to. |
java.lang.String |
getName()
Gets the name of this street. |
int |
getSpeed()
Gets the speed. |
Node |
getStartNode()
Gets the start node of this street. |
int |
getStartNodeTrafficLightState()
Gets the state of the traffic light. |
java.lang.String |
getStreetType_()
Gets the type of this street. |
int |
getTrafficLightEndX_()
|
int |
getTrafficLightEndY_()
|
int |
getTrafficLightStartX_()
|
int |
getTrafficLightStartY_()
|
double |
getXFactor()
Gets the x correction factor of one lane for position calculation (in cm). |
double |
getYFactor()
Gets the x correction factor of one lane for position calculation (in cm). |
int |
hashCode()
Creates a hash code (needed for HashMaps or similar structures). |
boolean |
isOneway()
Indicates if this is a oneway-street or not. |
boolean |
isPriorityOnEndNode()
|
boolean |
isPriorityOnStartNode()
|
void |
setDisplayColor(java.awt.Color displayColor)
Sets the display color of this street. |
void |
setEndNode(Node endNode)
|
void |
setEndNodeTrafficLightState(int endNodeTrafficLightState_)
Sets the status of the traffic light |
void |
setLanesCount(int laneCount)
Sets the amount of lanes. |
void |
setName(java.lang.String name)
Sets the name of this street. |
void |
setPriorityOnEndNode(boolean priorityOnEndNode)
|
void |
setPriorityOnStartNode(boolean priorityOnStartNode)
|
void |
setSpeed(int maxSpeed)
Sets the maximum speed. |
void |
setStartNode(Node startNode)
|
void |
setStartNodeTrafficLightState(int startNodeTrafficLightState_)
Sets the status of the traffic light |
void |
setStreetType_(java.lang.String streetType_)
Sets the type of this street. |
void |
setTrafficLightEndX_(int trafficLightEndX_)
|
void |
setTrafficLightEndY_(int trafficLightEndY_)
|
void |
setTrafficLightStartX_(int trafficLightStartX_)
|
void |
setTrafficLightStartY_(int trafficLightStartY_)
|
void |
updateEndNodeTrafficLightState()
Updates the state of the traffic light. |
void |
updateLaneObject(LaneObject object,
boolean direction,
double newPosition)
Updates a lane object. |
void |
updateStartNodeTrafficLightState()
Updates the state of the traffic light. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Street(java.lang.String name, Node startNode, Node endNode, java.lang.String streetType, int oneway, int lanes, java.awt.Color displayColor, Region mainRegion, int maxSpeed)
name
- the name of this streetstartNode
- the start nodeendNode
- the end nodestreetType
- type of the streetoneway
- 0
=twoway-street, 1
=oneway from startNode to endNode, else: oneway from endNode to startNodelanes
- the number of lanes on this street in one direction (!). Normal streets should have 1
here, motorways 2
or more!displayColor
- the color in which to paint this streetmainRegion
- the main regionmaxSpeed
- the maximum speed allowed on this streetMethod Detail |
---|
public double getLength()
public double getXFactor()
public double getYFactor()
public int getSpeed()
public void setSpeed(int maxSpeed)
maxSpeed
- the new speedpublic void changeOneWay(int oneway)
oneway
- 0
=twoway-street, 1
=oneway from startNode to endNode, else: oneway from endNode to startNodepublic int getLanesCount()
public void setLanesCount(int laneCount)
laneCount
- the number of lanes per directionpublic LaneObject getFirstLaneObject(boolean direction)
getNext()
and
getPrevious()
. Note that the lane might change while you're iterating as it's not synchronized!
direction
- true
in the direction from startNode to endNode, false
seen from
endNode to startNode
public LaneObject getLastLaneObject(boolean direction)
getNext()
and
getPrevious()
. Note that the lane might change while you're iterating as it's not synchronized!
direction
- true
in the direction from startNode to endNode, false
seen from
endNode to startNode
public void addLaneObject(LaneObject object, boolean direction)
object
- the object to adddirection
- true
in the direction from startNode to endNode, false
seen from
endNode to startNodepublic void delLaneObject(LaneObject object, boolean direction)
object
- the object to removedirection
- true
in the direction from startNode to endNode, false
seen from
endNode to startNodepublic void updateLaneObject(LaneObject object, boolean direction, double newPosition)
object
- the object to check for updatesdirection
- true
in the direction from startNode to endNode, false
seen from
endNode to startNodenewPosition
- the new position of the objectpublic void clearLanes()
public void addBridgePaintLine(double x1, double y1, double x2, double y2)
x1
- the x coordinate of the start pointy1
- the y coordinate of the start pointx2
- the x coordinate of the end pointy2
- the y coordinate of the end pointpublic void addBridgePaintPolygon(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
x1
- the x coordinate of the first pointy1
- the y coordinate of the first pointx2
- the x coordinate of the second pointy2
- the y coordinate of the second pointx3
- the x coordinate of the third pointy3
- the y coordinate of the third pointx4
- the x coordinate of the fourth pointy4
- the y coordinate of the fourth pointpublic java.util.ArrayList<java.awt.geom.Point2D.Double> getBridgePaintLines()
ArrayList
with all lines to paint (two successive points are a line)public java.util.ArrayList<java.awt.geom.Point2D.Double> getBridgePaintPolygons()
ArrayList
with all lines to paint (two successive points are a line)public Node getStartNode()
public void setStartNode(Node startNode)
public Node getEndNode()
public void setEndNode(Node endNode)
public java.awt.Color getDisplayColor()
public void setDisplayColor(java.awt.Color displayColor)
displayColor
- the new display colorpublic Region getMainRegion()
public void setName(java.lang.String name)
name
- the new namepublic java.lang.String getName()
public boolean isOneway()
true
if it's oneway, else false
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the object to compare to
true
, if equalsObject.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public java.lang.String getStreetType_()
public void setStreetType_(java.lang.String streetType_)
streetType_
- the type of the streetpublic int getStartNodeTrafficLightState()
public void setStartNodeTrafficLightState(int startNodeTrafficLightState_)
startNodeTrafficLightState_
- the status of the traffic lightpublic int getEndNodeTrafficLightState()
public void setEndNodeTrafficLightState(int endNodeTrafficLightState_)
endNodeTrafficLightState_
- the status of the traffic lightpublic void updateStartNodeTrafficLightState()
public void updateEndNodeTrafficLightState()
public void setTrafficLightEndX_(int trafficLightEndX_)
trafficLightEndX_
- the trafficLightEndX_ to setpublic int getTrafficLightEndX_()
public void setTrafficLightStartX_(int trafficLightStartX_)
trafficLightStartX_
- the trafficLightStartX_ to setpublic int getTrafficLightStartX_()
public void setTrafficLightStartY_(int trafficLightStartY_)
trafficLightStartY_
- the trafficLightStartY_ to setpublic int getTrafficLightStartY_()
public void setTrafficLightEndY_(int trafficLightEndY_)
trafficLightEndY_
- the trafficLightEndY_ to setpublic int getTrafficLightEndY_()
public void setPriorityOnEndNode(boolean priorityOnEndNode)
priorityOnEndNode
- the priorityOnEndNode to setpublic boolean isPriorityOnEndNode()
public void setPriorityOnStartNode(boolean priorityOnStartNode)
priorityOnStartNode
- the priorityOnStartNode to setpublic boolean isPriorityOnStartNode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |