java.lang.Object
io.jenetics.jpx.Bounds
- All Implemented Interfaces:
Serializable
Two lat/lon pairs defining the extent of an element.
- Since:
- 1.0
- Version:
- 1.6
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn the maximum latitude.Return the maximum longitudeReturn the minimum latitude.Return the minimum longitude.inthashCode()static Boundsof(double minLatitudeDegree, double minLongitudeDegree, double maxLatitudeDegree, double maxLongitudeDegree) Create a newBoundsobject with the given extent.static BoundsCreate a newBoundsobject with the given extent.toBounds()Return a collector which calculates the bounds of a given way-point stream.toString()
-
Method Details
-
getMinLatitude
Return the minimum latitude.- Returns:
- the minimum latitude
-
getMinLongitude
Return the minimum longitude.- Returns:
- the minimum longitude
-
getMaxLatitude
Return the maximum latitude.- Returns:
- the maximum latitude
-
getMaxLongitude
Return the maximum longitude- Returns:
- the maximum longitude
-
hashCode
-
equals
-
toString
-
toBounds
Return a collector which calculates the bounds of a given way-point stream. The following example shows how to calculate the bounds of all track-points of a given GPX object.If the collecting way-point stream is empty, the collectedfinal Bounds bounds = gpx.tracks() .flatMap(Track::segments) .flatMap(TrackSegment::points) .collect(Bounds.toBounds());Boundsobject isnull.- Type Parameters:
P- The actual point type- Returns:
- a new bounds collector
- Since:
- 1.6
-
of
public static Bounds of(Latitude minLatitude, Longitude minLongitude, Latitude maxLatitude, Longitude maxLongitude) Create a newBoundsobject with the given extent.- Parameters:
minLatitude- the minimum latitudeminLongitude- the minimum longitudemaxLatitude- the maximum latitudemaxLongitude- the maximum longitude- Returns:
- a new
Boundsobject with the given extent - Throws:
NullPointerException- if one of the arguments isnull
-
of
public static Bounds of(double minLatitudeDegree, double minLongitudeDegree, double maxLatitudeDegree, double maxLongitudeDegree) Create a newBoundsobject with the given extent.- Parameters:
minLatitudeDegree- the minimum latitudeminLongitudeDegree- the minimum longitudemaxLatitudeDegree- the maximum latitudemaxLongitudeDegree- the maximum longitude- Returns:
- a new
Boundsobject with the given extent - Throws:
IllegalArgumentException- if the latitude values are not within the range of[-90..90]IllegalArgumentException- if the longitudes value are not within the range of[-180..180]
-