java.lang.Object
io.jenetics.jpx.Route
- All Implemented Interfaces:
Serializable,Iterable<WayPoint>
Represents a route - an ordered list of way-points representing a series of
turn points leading to a destination.
Create a new route via the builder:
final Route route = Route.builder()
.name("Route 1")
.description("Fancy mountain-bike tour.")
.addPoint(p -> p.lat(48.2081743).lon(16.3738189).ele(160))
.addPoint(p -> p.lat(48.2081743).lon(16.3738189).ele(161))
.addPoint(p -> p.lat(48.2081743).lon(16.3738189).ele(162))))
.build();- Since:
- 1.0
- Version:
- 1.5
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder class for buildingRouteobjects. -
Method Summary
Modifier and TypeMethodDescriptionstatic Route.Builderbuilder()Return a newRoutebuilder object.booleanReturn the GPS comment of the route.Return the Text description of route for user.Return the (cloned) extensions document.getLinks()Return the links to external information about the route.getName()Return the route name.Return the GPS route number.Return the sequence of route points.Return the source of data.getType()Return the type (classification) of the route.inthashCode()booleanisEmpty()Returntrueif all route properties arenullor empty.iterator()booleannonEmpty()Returntrueif not all route properties arenullor empty.static Routeof(String name, String comment, String description, String source, List<Link> links, UInt number, String type, List<WayPoint> points) Create a newRoutewith the given parameters and way-points.static Routeof(String name, String comment, String description, String source, List<Link> links, UInt number, String type, Document extensions, List<WayPoint> points) Create a newRoutewith the given parameters and way-points.static RouteCreate a newRoutewith the given parameters and way-points.static RouteCreate a newRoutewith the given parameters and way-points.points()Return a stream ofWayPointobjects this route contains.Convert the immutable route object into a mutable builder initialized with the current route values.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getName
Return the route name.- Returns:
- the route name
-
getComment
Return the GPS comment of the route.- Returns:
- the GPS comment of the route
-
getDescription
Return the Text description of route for user. Not sent to GPS.- Returns:
- the Text description of route for user. Not sent to GPS
-
getSource
Return the source of data. Included to give user some idea of reliability and accuracy of data.- Returns:
- the source of data
-
getLinks
Return the links to external information about the route.- Returns:
- the links to external information about the route
-
getNumber
Return the GPS route number.- Returns:
- the GPS route number
-
getType
Return the type (classification) of the route.- Returns:
- the type (classification) of the route
-
getPoints
Return the sequence of route points.- Returns:
- the sequence of route points
-
points
Return a stream ofWayPointobjects this route contains.- Returns:
- a stream of
WayPointobjects this route contains
-
getExtensions
Return the (cloned) extensions document. The root element of the returned document has the nameextensions.<extensions> ... </extensions>- Returns:
- the extensions document
- Throws:
DOMException- if the document could not be cloned, because of an erroneous XML configuration- Since:
- 1.5
-
iterator
-
toBuilder
Convert the immutable route object into a mutable builder initialized with the current route values.- Returns:
- a new route builder initialized with the values of
thisroute - Since:
- 1.1
-
isEmpty
Returntrueif all route properties arenullor empty.- Returns:
trueif all route properties arenullor empty
-
nonEmpty
Returntrueif not all route properties arenullor empty.- Returns:
trueif not all route properties arenullor empty- Since:
- 1.1
-
hashCode
-
equals
-
toString
-
builder
Return a newRoutebuilder object.- Returns:
- a new
Routebuilder object
-
of
public static Route of(String name, String comment, String description, String source, List<Link> links, UInt number, String type, Document extensions, List<WayPoint> points) Create a newRoutewith the given parameters and way-points.- Parameters:
name- the GPS name of the routecomment- the GPS comment of the routedescription- the Text description of route for user. Not sent to GPS.source- the source of data. Included to give user some idea of reliability and accuracy of data.links- the links to external information about the routenumber- the GPS route numbertype- the type (classification) of the routeextensions- the extensions documentpoints- the sequence of route points- Returns:
- a new route object with the given parameters
- Since:
- 1.5
-
of
public static Route of(String name, String comment, String description, String source, List<Link> links, UInt number, String type, List<WayPoint> points) Create a newRoutewith the given parameters and way-points.- Parameters:
name- the GPS name of the routecomment- the GPS comment of the routedescription- the Text description of route for user. Not sent to GPS.source- the source of data. Included to give user some idea of reliability and accuracy of data.links- the links to external information about the routenumber- the GPS route numbertype- the type (classification) of the routepoints- the sequence of route points- Returns:
- a new route object with the given parameters
-
of
Create a newRoutewith the given parameters and way-points.- Parameters:
name- the GPS name of the routepoints- the sequence of route points- Returns:
- a new route object with the given parameters
-
of
Create a newRoutewith the given parameters and way-points.- Parameters:
points- the sequence of route points- Returns:
- a new route object with the given parameters
-