Package org.insa.graphs.model
Class RoadInformation
- java.lang.Object
-
- org.insa.graphs.model.RoadInformation
-
public class RoadInformation extends java.lang.Object
Class containing information for road that may be shared by multiple arcs.
Sharing information between arcs reduces memory footprints of the program (a long road is often split into multiple arcs at each intersection).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RoadInformation.RoadType
Enumeration for road types.
-
Constructor Summary
Constructors Constructor Description RoadInformation(RoadInformation.RoadType roadType, AccessRestrictions access, boolean isOneWay, int maxSpeed, java.lang.String name)
Create a new RoadInformation instance containing the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessRestrictions
getAccessRestrictions()
int
getMaximumSpeed()
java.lang.String
getName()
RoadInformation.RoadType
getType()
boolean
isOneWay()
java.lang.String
toString()
-
-
-
Constructor Detail
-
RoadInformation
public RoadInformation(RoadInformation.RoadType roadType, AccessRestrictions access, boolean isOneWay, int maxSpeed, java.lang.String name)
Create a new RoadInformation instance containing the given parameters.- Parameters:
roadType
- Type of the road (seeRoadInformation.RoadType
).access
- Access restrictions for the road (seeAccessRestrictions
).isOneWay
- true if this road is a one way road, false otherwise.maxSpeed
- Maximum speed for the road (in kilometers-per-hour).name
- Name of the road.
-
-
Method Detail
-
getAccessRestrictions
public AccessRestrictions getAccessRestrictions()
- Returns:
- Access restrictions for this road.
-
getType
public RoadInformation.RoadType getType()
- Returns:
- Type of the road.
-
isOneWay
public boolean isOneWay()
- Returns:
- true if the road is a one-way road.
-
getMaximumSpeed
public int getMaximumSpeed()
- Returns:
- Maximum speed for this road (in kilometers-per-hour).
-
getName
public java.lang.String getName()
- Returns:
- Name of the road.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-