- java.lang.Object
-
- java.lang.Enum<TrafficDirection>
-
- org.arakhne.afc.gis.road.primitive.TrafficDirection
-
- All Implemented Interfaces:
Serializable
,Comparable<TrafficDirection>
public enum TrafficDirection extends Enum<TrafficDirection>
Direction of the traffic on a road segment. The traffic direction is given according to the geometrical direction of the road segment.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:55
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- gisroad
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DOUBLE_WAY
The road segment is traversable in both directions.NO_ENTRY
The road segment is not traversable from the first point to the last, but is traversable from the last to the first point.NO_WAY
The road segment is not traversable in both directions.ONE_WAY
The road segment is traversable from the first point to the last, and not from the last to the first point.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TrafficDirection
fromString(String value)
Replies the traffic direction which is corresponding to the given string value.static TrafficDirection
valueOf(String name)
Returns the enum constant of this type with the specified name.static TrafficDirection[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ONE_WAY
public static final TrafficDirection ONE_WAY
The road segment is traversable from the first point to the last, and not from the last to the first point.
-
NO_ENTRY
public static final TrafficDirection NO_ENTRY
The road segment is not traversable from the first point to the last, but is traversable from the last to the first point.
-
DOUBLE_WAY
public static final TrafficDirection DOUBLE_WAY
The road segment is traversable in both directions.
-
NO_WAY
public static final TrafficDirection NO_WAY
The road segment is not traversable in both directions.
-
-
Method Detail
-
values
public static TrafficDirection[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TrafficDirection c : TrafficDirection.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TrafficDirection valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
fromString
@Pure public static TrafficDirection fromString(String value)
Replies the traffic direction which is corresponding to the given string value. The value is matched according toRoadNetworkConstants.getPreferredAttributeValueForTrafficDirection(TrafficDirection, int)
.- Parameters:
value
- the value to parse.- Returns:
- the traffic direction if matched, otherwise
null
if the given value does not match any constant.
-
-