java.lang.Object
io.jenetics.jpx.WayPoint.Builder
- Enclosing class:
- WayPoint
Builder for creating a way-point with different parameters.
Creating a WayPoint:
final WayPoint point = WayPoint.builder()
.lat(48.2081743).lon(16.3738189).ele(160)
.build();- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionSet the links to external information about the way-point.Set the links to external information about the way-point.Return the current age since last DGPS update.ageofdgpsdata(double seconds) Set the number of seconds since last DGPS update.ageofdgpsdata(Duration age) Set the age since last DGPS update.build()Build a new way-point from the current builder state.build(double latitude, double longitude) Create a new way-point with the given latitude and longitude value.Create a new way-point with the given latitude and longitude value.cmt()Return the current comment value.Set the GPS way-point comment.course()Return the instantaneous course at the point.course(double courseDegrees) Set the the instantaneous course at the point.Set the the instantaneous course at the point.desc()Return the current description value.Set the GPS way-point description.dgpsid()Return the current the ID of DGPS station used in differential correction.dgpsid(int station) Set the ID of DGPS station used in differential correction.dgpsid(DGPSStation station) Set the ID of DGPS station used in differential correction.ele()Return the current elevation value.ele(double meters) Set the elevation (in meters) of the point.ele(double elevation, Length.Unit unit) Set the elevation of the point.Set the elevation of the point.Return the current extensionsextensions(Document extensions) Sets the extensions object, which may benull.fix()Return the current GPX fix value.Set the type of GPX fix.Set the type of GPX fix.Return the current height of geoid value.geoidheight(double meter) Set the height (in meters) of geoid (mean sea level) above WGS84 earth ellipsoid.geoidheight(double length, Length.Unit unit) Set the height of geoid (mean sea level) above WGS84 earth ellipsoid.geoidheight(Length height) Set the height (in meters) of geoid (mean sea level) above WGS84 earth ellipsoid.hdop()Return the current horizontal dilution.Set the horizontal dilution of precision.lat()Return the current latitude value.lat(double degrees) Set the latitude value of the way-point.Set the latitude value of the way-point.links()Return the current links.Set the links to additional information about the way-point.lon()Return the current longitude value.lon(double degrees) Set the longitude value of the way-point.Set the longitude value of the way-point.magvar()Return the current magnetic variation value.magvar(double degree) Set the magnetic variation at the point.Set the magnetic variation at the point.name()Return the current name value.Set the GPS name of the way-point.pdop()Return the current position dilution.Set the position dilution of precision.sat()Return the current number of satelites.sat(int sat) Set the number of satellites used to calculate the GPX fix.Set the number of satellites used to calculate the GPX fix.speed()Return the current speed value.speed(double meterPerSecond) Set the current GPS speed.speed(double speed, Speed.Unit unit) Set the current GPS speedSet the current GPS speed.src()Return the current source value.Set the GPS way-point source.sym()Return the current symbol value.Set the text of GPS symbol name.time()Return the current time value.time(long millis) Set the creation/modification timestamp for the point.Set the creation/modification timestamp for the point.type()Return the current type value.Set the type (classification) of the way-point.vdop()Return the current vertical dilution.Set the vertical dilution of precision.
-
Method Details
-
lat
Set the latitude value of the way-point.- Parameters:
latitude- the new latitude value- Returns:
thisBuilderfor method chaining- Throws:
NullPointerException- if the given value isnull
-
lat
Set the latitude value of the way-point.- Parameters:
degrees- the new latitude value- Returns:
thisBuilderfor method chaining- Throws:
IllegalArgumentException- if the given value is not within the range of[-90..90]
-
lat
Return the current latitude value.- Returns:
- the current latitude value
- Since:
- 1.1
-
lon
Set the longitude value of the way-point.- Parameters:
longitude- the new longitude value- Returns:
thisBuilderfor method chaining- Throws:
NullPointerException- if the given value isnull
-
lon
Set the longitude value of the way-point.- Parameters:
degrees- the new longitude value- Returns:
thisBuilderfor method chaining- Throws:
IllegalArgumentException- if the given value is not within the range of[-180..180]
-
lon
Return the current longitude value.- Returns:
- the current longitude value
- Since:
- 1.1
-
ele
Set the elevation of the point.- Parameters:
elevation- the elevation of the point- Returns:
thisBuilderfor method chaining
-
ele
Set the elevation (in meters) of the point.- Parameters:
meters- the elevation of the point, in meters- Returns:
thisBuilderfor method chaining
-
ele
Set the elevation of the point.- Parameters:
elevation- the elevation of the pointunit- the length unit- Returns:
thisBuilderfor method chaining
-
ele
Return the current elevation value.- Returns:
- the current elevation value
- Since:
- 1.1
-
speed
Set the current GPS speed.- Parameters:
speed- the current GPS speed- Returns:
thisBuilderfor method chaining
-
speed
Set the current GPS speed- Parameters:
speed- the current speed valueunit- the speed unit- Returns:
thisBuilderfor method chaining
-
speed
Set the current GPS speed.- Parameters:
meterPerSecond- the current GPS speed in m/s- Returns:
thisBuilderfor method chaining
-
speed
Return the current speed value.- Returns:
- the current speed value
- Since:
- 1.1
-
time
Set the creation/modification timestamp for the point.- Parameters:
instant- the instant of the way-point- Returns:
thisBuilderfor method chaining
-
time
Set the creation/modification timestamp for the point.- Parameters:
millis- the instant of the way-point- Returns:
thisBuilderfor method chaining
-
time
Return the current time value.- Returns:
- the current time value
-
magvar
Set the magnetic variation at the point.- Parameters:
variation- the magnetic variation- Returns:
thisBuilderfor method chaining
-
magvar
Set the magnetic variation at the point.- Parameters:
degree- the magnetic variation- Returns:
thisBuilderfor method chaining- Throws:
IllegalArgumentException- if the give value is not within the range of[0..360]
-
magvar
Return the current magnetic variation value.- Returns:
- the current magnetic variation value
- Since:
- 1.1
-
geoidheight
Set the height (in meters) of geoid (mean sea level) above WGS84 earth ellipsoid. As defined in NMEA GGA message.- Parameters:
height- the height (in meters) of geoid (mean sea level) above WGS84 earth ellipsoid- Returns:
thisBuilderfor method chaining
-
geoidheight
Set the height (in meters) of geoid (mean sea level) above WGS84 earth ellipsoid. As defined in NMEA GGA message.- Parameters:
meter- the height (in meters) of geoid (mean sea level) above WGS84 earth ellipsoid- Returns:
thisBuilderfor method chaining
-
geoidheight
Set the height of geoid (mean sea level) above WGS84 earth ellipsoid. As defined in NMEA GGA message.- Parameters:
length- the height of geoid (mean sea level) above WGS84 earth ellipsoidunit- the length unit- Returns:
thisBuilderfor method chaining
-
geoidheight
Return the current height of geoid value.- Returns:
- the current height of geoid value
- Since:
- 1.1
-
name
Set the GPS name of the way-point. This field will be transferred to and from the GPS. GPX does not place restrictions on the length of this field or the characters contained in it. It is up to the receiving application to validate the field before sending it to the GPS.- Parameters:
name- the GPS name of the way-point- Returns:
thisBuilderfor method chaining
-
name
Return the current name value.- Returns:
- the current name value
- Since:
- 1.1
-
cmt
Set the GPS way-point comment.- Parameters:
comment- the GPS way-point comment.- Returns:
thisBuilderfor method chaining
-
cmt
Return the current comment value.- Returns:
- the current comment value
- Since:
- 1.1
-
desc
Set the GPS way-point description.- Parameters:
description- the GPS way-point description.- Returns:
thisBuilderfor method chaining
-
desc
Return the current description value.- Returns:
- the current description value
- Since:
- 1.1
-
src
Set the GPS way-point source.- Parameters:
source- the GPS way-point source.- Returns:
thisBuilderfor method chaining
-
src
Return the current source value.- Returns:
- the current source value
- Since:
- 1.1
-
links
Set the links to additional information about the way-point. The link list may benull.- Parameters:
links- the links to additional information about the way-point- Returns:
thisBuilderfor method chaining- Throws:
NullPointerException- if one of the links in the list isnull
-
addLink
Set the links to external information about the way-point.- Parameters:
link- the links to external information about the way-point.- Returns:
thisBuilderfor method chaining
-
addLink
Set the links to external information about the way-point.- Parameters:
href- the links to external information about the way-point.- Returns:
thisBuilderfor method chaining- Throws:
IllegalArgumentException- if the givenhrefis not a valid URL
-
links
Return the current links. The returned link list is mutable.- Returns:
- the current links
- Since:
- 1.1
-
sym
Set the text of GPS symbol name. For interchange with other programs, use the exact spelling of the symbol as displayed on the GPS. If the GPS abbreviates words, spell them out.- Parameters:
symbol- the text of GPS symbol name- Returns:
thisBuilderfor method chaining
-
sym
Return the current symbol value.- Returns:
- the current symbol value
- Since:
- 1.1
-
type
Set the type (classification) of the way-point.- Parameters:
type- the type (classification) of the way-point- Returns:
thisBuilderfor method chaining
-
type
Return the current type value.- Returns:
- the current type value
- Since:
- 1.1
-
fix
Set the type of GPX fix.- Parameters:
fix- the type of GPX fix- Returns:
thisBuilderfor method chaining
-
fix
Set the type of GPX fix.- Parameters:
fix- the type of GPX fix- Returns:
thisBuilderfor method chaining- Throws:
IllegalArgumentException- if the fix value is not one of the following values: [none, 2d, 3d, dgps, pps]
-
fix
Return the current GPX fix value.- Returns:
- the current GPX fix value
- Since:
- 1.1
-
sat
Set the number of satellites used to calculate the GPX fix.- Parameters:
sat- the number of satellites used to calculate the GPX fix- Returns:
thisBuilderfor method chaining
-
sat
Set the number of satellites used to calculate the GPX fix.- Parameters:
sat- the number of satellites used to calculate the GPX fix- Returns:
thisBuilderfor method chaining- Throws:
IllegalArgumentException- if the givenvalueis smaller than zero
-
sat
Return the current number of satelites.- Returns:
- the current number of satelites
- Since:
- 1.1
-
hdop
Set the horizontal dilution of precision.- Parameters:
hdop- the horizontal dilution of precision- Returns:
thisBuilderfor method chaining
-
hdop
Return the current horizontal dilution.- Returns:
- the current horizontal dilution
- Since:
- 1.1
-
vdop
Set the vertical dilution of precision.- Parameters:
vdop- the vertical dilution of precision- Returns:
thisBuilderfor method chaining
-
vdop
Return the current vertical dilution.- Returns:
- the current vertical dilution
- Since:
- 1.1
-
pdop
Set the position dilution of precision.- Parameters:
pdop- the position dilution of precision- Returns:
thisBuilderfor method chaining
-
pdop
Return the current position dilution.- Returns:
- the current position dilution
- Since:
- 1.1
-
ageofdgpsdata
Set the age since last DGPS update.- Parameters:
age- the age since last DGPS update- Returns:
thisBuilderfor method chaining
-
ageofdgpsdata
Set the number of seconds since last DGPS update.- Parameters:
seconds- the age since last DGPS update- Returns:
thisBuilderfor method chaining
-
ageofdgpsdata
Return the current age since last DGPS update.- Returns:
- the current age since last DGPS update
- Since:
- 1.1
-
dgpsid
Set the ID of DGPS station used in differential correction.- Parameters:
station- the ID of DGPS station used in differential correction- Returns:
thisBuilderfor method chaining
-
dgpsid
Set the ID of DGPS station used in differential correction.- Parameters:
station- the ID of DGPS station used in differential correction- Returns:
thisBuilderfor method chaining- Throws:
IllegalArgumentException- if the given station number is not in the range of[0..1023]
-
dgpsid
Return the current the ID of DGPS station used in differential correction.- Returns:
- the current the ID of DGPS station used in differential correction
- Since:
- 1.1
-
course
Set the the instantaneous course at the point.- Parameters:
course- the the instantaneous course at the point- Returns:
thisBuilderfor method chaining- Since:
- 1.3
-
course
Set the the instantaneous course at the point.- Parameters:
courseDegrees- the the instantaneous course at the point- Returns:
thisBuilderfor method chaining- Throws:
IllegalArgumentException- if the give value is not within the range of[0..360]- Since:
- 1.3
-
course
Return the instantaneous course at the point.- Returns:
- the instantaneous course at the point.
- Since:
- 1.3
-
extensions
Sets the extensions object, which may benull. The root element of the extensions document must beextensions.<extensions> ... </extensions>- Parameters:
extensions- the document- Returns:
thisBuilderfor method chaining- Throws:
IllegalArgumentException- if the root element is not the anextensionsnode- Since:
- 1.5
-
extensions
Return the current extensions- Returns:
- the extensions document
- Since:
- 1.5
-
build
Create a new way-point with the given latitude and longitude value.- Parameters:
latitude- the latitude of the way-pointlongitude- the longitude of the way-point- Returns:
- a newly created way-point
-
build
Create a new way-point with the given latitude and longitude value.- Parameters:
latitude- the latitude of the way-pointlongitude- the longitude of the way-point- Returns:
- a newly created way-point
-
build
Build a new way-point from the current builder state.- Returns:
- a new way-point from the current builder state
- Throws:
IllegalStateException- if theWayPoint.getLatitude()orWayPoint.getLongitude()isnullor has not been set, respectively.
-