Package com.navmii.sdk.routecalculation
Class RouteCalculationSession
java.lang.Object
com.navmii.sdk.routecalculation.RouteCalculationSession
public abstract class RouteCalculationSession
extends java.lang.Object
Interface representing a route calculation session.
Each route calculation session corresponds to one and only one route calculation or snapping process.
-
Constructor Summary
Constructors Constructor Description RouteCalculationSession()
-
Method Summary
Modifier and Type Method Description abstract void
cancel()
Cancels the route calculation session.abstract java.util.ArrayList<RouteCalculationError>
getErrors()
Returns list of non-fatal errors occurred during route calculation process.abstract RouteCalculationFailureInfo
getFailureInfo()
Returns unsuccessful route calculation result if available and 'null' otherwise.abstract RouteCalculationResult
getResult()
Returns successful route calculation result if available and 'null' otherwise.abstract boolean
hasFailed()
Specifies whether the route calculation session has failed.abstract boolean
hasFinished()
Specifies whether route calculation session is in progress.abstract boolean
hasSucceeded()
Specifies whether the route calculation session has succeeded.abstract boolean
wasCanceled()
Specifies whether the route calculation session was canceled by a user.
-
Constructor Details
-
RouteCalculationSession
public RouteCalculationSession()
-
-
Method Details
-
hasFinished
public abstract boolean hasFinished()Specifies whether route calculation session is in progress. Once session has finished you can expect its state doesn't change. The hasFinished method returns 'true' if either of the following happened: route calculation has succeeded, failed or the session was canceled by a user by calling the cancel method. -
wasCanceled
public abstract boolean wasCanceled()Specifies whether the route calculation session was canceled by a user. The only way to cancel route calculation session is to call the cancel method before the session has finished. If wasCanceled method returns 'true', then hasFinished method returns 'true', both hasSucceeded and hasFailed methods return 'false', both getResult and getFailureInfo methods return 'null'. -
hasSucceeded
public abstract boolean hasSucceeded()Specifies whether the route calculation session has succeeded. The method returns 'true' if route calculation session has finished and succeeded. In this case getResult method returns valid nonnull calculation result, getFailureInfo method returns 'null', hasFinished method returns 'true', both wasCanceled and hasFailed methods return 'false'. -
getResult
Returns successful route calculation result if available and 'null' otherwise. The method only returns nonnull if both hasFinished and hasSucceeded methods return 'true'. -
hasFailed
public abstract boolean hasFailed()Specifies whether the route calculation session has failed. The method returns 'true' if route calculation session has finished and failed. In this case getFailureInfo method returns valid nonnull failure info, getResult method returns 'null', hasFinished method returns 'true', both wasCanceled and hasSucceeded methods return 'false'. -
getFailureInfo
Returns unsuccessful route calculation result if available and 'null' otherwise. The method only returns nonnull if both hasFinished and hasFailed methods return 'true'. -
getErrors
Returns list of non-fatal errors occurred during route calculation process. When non-fatal error occurs, route calculation process doesn't finish (it keeps trying to calculate a route), but error code is stored withing the session. -
cancel
public abstract void cancel()Cancels the route calculation session. After the route calculation session was canceled it's considered as finished, which means both hasFinished and wasCanceled methods return 'true', hasSucceeded and hasFailed methods return 'false', getResult and getFailureInfo methods return 'null'. After active route calculation session was canceled, onCanceled listener is called. Calling the method after the session has finished has no effect.
-