Loading...
Searching...
No Matches
com.navigine.idl.java.RoutePath Class Referenceabstract

class is used for storing the route path between the two points on the location. More...

Public Member Functions

abstract RoutePath head (float advance)
 Returns the leading segment of the route.
 
abstract RoutePath tail (float advance)
 Returns the remaining segment of the route.
 
abstract float getLength ()
 Total lenth of the route path in meters.
 
abstract ArrayList< RouteEventgetEvents ()
 List of consecutive incoming events RouteEvent.
 
abstract ArrayList< LocationPointgetPoints ()
 List of consecutive points. com.navigine.idl.java.LocationPoint.
 

Detailed Description

class is used for storing the route path between the two points on the location.

Referenced from: AsyncRouteListener, AsyncRouteManager, Location, RouteListener, RouteManager

Definition at line 20 of file RoutePath.java.

Member Function Documentation

◆ getEvents()

abstract ArrayList< RouteEvent > com.navigine.idl.java.RoutePath.getEvents ( )
abstract

List of consecutive incoming events RouteEvent.

Returns

Java code snippet:

// Get route events
List<RouteEvent> events = path.getEvents();
System.out.println("Route has " + events.size() + " events");
for (int j = 0; j < events.size(); j++) {
}

Kotlin code snippet:

// Get route events
val events = path.events
println("Route has ${events.size} events")
events.forEach { event ->
demonstrateRouteEventUsage(event)
}

◆ getLength()

abstract float com.navigine.idl.java.RoutePath.getLength ( )
abstract

Total lenth of the route path in meters.

Returns

Java code snippet:

// Get route length
double length = path.getLength();
System.out.println("Route length: " + length + " meters");

Kotlin code snippet:

// Get route length
val length = path.length
println("Route length: $length meters")

◆ getPoints()

abstract ArrayList< LocationPoint > com.navigine.idl.java.RoutePath.getPoints ( )
abstract

List of consecutive points. com.navigine.idl.java.LocationPoint.

Returns
Note
points could be on different sublocations if target sublocation is different from the starting one

Java code snippet:

// Get route points
List<LocationPoint> points = path.getPoints();
System.out.println("Route has " + points.size() + " points");
for (int j = 0; j < points.size(); j++) {
}

Kotlin code snippet:

// Get route points
val points = path.points
println("Route has ${points.size} points")
points.forEach { point ->
demonstrateLocationPointUsage(point)
}

◆ head()

abstract RoutePath com.navigine.idl.java.RoutePath.head ( float advance)
abstract

Returns the leading segment of the route.

Returns the portion of the route from the start up to the specified advance distance along the route. If advance exceeds the total route length, the entire route is returned.

Parameters
advanceDistance along the route (in meters).
Returns
The covered (passed) segment of the route (from start to advance), or nil if the segment is empty.

Java code snippet:

// Get head of route (first 10 meters)
RoutePath headPath = path.head(10.0);
if (headPath != null) {
System.out.println("Head path length: " + headPath.getLength() + " meters");
}

Kotlin code snippet:

// Get head of route (first 10 meters)
val headPath = path.head(10.0)
headPath?.let {
println("Head path length: ${it.length} meters")
}

◆ tail()

abstract RoutePath com.navigine.idl.java.RoutePath.tail ( float advance)
abstract

Returns the remaining segment of the route.

Returns the portion of the route starting from the specified advance distance to the end of the route. If advance is less than or equal to zero, the entire route is returned.

Parameters
advanceDistance along the route (in meters).
Returns
The remaining segment of the route (from advance to end), or nil if the segment is empty.

Java code snippet:

// Get tail of route (remaining after 10 meters)
RoutePath tailPath = path.tail(10.0);
if (tailPath != null) {
System.out.println("Tail path length: " + tailPath.getLength() + " meters");
}

Kotlin code snippet:

// Get tail of route (remaining after 10 meters)
val tailPath = path.tail(10.0)
tailPath?.let {
println("Tail path length: ${it.length} meters")
}

The documentation for this class was generated from the following file: