public final class SegmentUpdate extends Object implements Update
| Modifier and Type | Method and Description |
|---|---|
static SegmentUpdate |
buildSegmentExclude(String segmentId,
boolean exclude)
This method can be used to create a segment update which exclude the specified segment
from the route\matrix calculation.
|
static SegmentUpdate |
buildSegmentRoadTypeUpdate(String segmentId,
RoadType roadType)
This is a roadtype update where you can change the roadType of the segment by specifying
the new
RoadType. |
static SegmentUpdate |
buildSegmentSpeedAdjustment(String segmentId,
Velocity speedAdjustment)
This is a speed update where you define a change in the speed of the segment by specifying
the change in
Velocity. |
static SegmentUpdate |
buildSegmentSpeedPercentageUpdate(String segmentId,
int percentage)
This method can be used to create a segment speed update where you define an increase
in the speed of the segment by specifying a percentage, to increase(positive value) or
decrease(negative value) the speed.
|
static SegmentUpdate |
buildSegmentSpeedUpdate(String segmentId,
Velocity speed)
This method can be used to create a segment speed update where you can update speed
of the segment by specifying a
Velocity |
int |
getPercentage()
Return the speed percentage set for update.
|
RoadType |
getRoadType()
Return the roadType set for update.
|
String |
getSegmentId()
Returns the segment Id for which the update was created.
|
Velocity |
getSpeed()
Return the speed set for update.
|
Velocity |
getSpeedAdjustment()
Return the speed adjustment set for update.
|
boolean |
isExclude()
Check if the segment is excluded.
|
public static SegmentUpdate buildSegmentExclude(String segmentId, boolean exclude) throws RoutingException
segmentId - must be a valid segment id in the form a:b.exclude - Boolean true or falseRoutingExceptionpublic static SegmentUpdate buildSegmentSpeedPercentageUpdate(String segmentId, int percentage) throws RoutingException
segmentId - must be a valid segment id in the form a:bpercentage - integer value must be less than 100, greater than -100 and !=0RoutingExceptionpublic static SegmentUpdate buildSegmentSpeedUpdate(String segmentId, Velocity speed) throws RoutingException
VelocitysegmentId - must be a valid segment id in the form a:bspeed - Velocity speed must be greater than 0RoutingExceptionpublic static SegmentUpdate buildSegmentSpeedAdjustment(String segmentId, Velocity speedAdjustment) throws RoutingException
Velocity. Speed values can be increased(positive value) or
decreases(negative value). The speed adjustment should not result in a negative speed value.segmentId - must be a valid segment id in the form a:bspeedAdjustment - Velocity speed should not be equal to 0RoutingExceptionpublic static SegmentUpdate buildSegmentRoadTypeUpdate(String segmentId, RoadType roadType) throws RoutingException
RoadType.segmentId - must be a valid segment id in the form a:broadType - RoadTypeRoutingExceptionpublic String getSegmentId()
public boolean isExclude()
true or falsepublic Velocity getSpeedAdjustment()
Velocitypublic int getPercentage()
percentage value.