Package slash.navigation.common
Record Class BoundingBox
java.lang.Object
java.lang.Record
slash.navigation.common.BoundingBox
public record BoundingBox(NavigationPosition northEast, NavigationPosition southWest)
extends Record
An area defined by the north east and south west
NavigationPositions.- Author:
- Christian Pesch
-
Constructor Summary
ConstructorsConstructorDescriptionBoundingBox(Double longitudeNorthEast, Double latitudeNorthEast, Double longitudeSouthWest, Double latitudeSouthWest) BoundingBox(NavigationPosition northEast, NavigationPosition southWest) Creates an instance of aBoundingBoxrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic BoundingBoxasBoundingBox(List<? extends NavigationPosition> positions) booleancontains(BoundingBox other) booleancontains(NavigationPosition position) final booleanIndicates whether some other object is "equal to" this one.doublefinal inthashCode()Returns a hash code value for this object.intersect(BoundingBox other) Returns the value of thenorthEastrecord component.Returns the value of thesouthWestrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
BoundingBox
-
-
Method Details
-
asBoundingBox
-
getSouthEast
-
getNorthWest
-
getSquareSize
public double getSquareSize() -
getCenter
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
northEast
Returns the value of thenorthEastrecord component.- Returns:
- the value of the
northEastrecord component
-
southWest
Returns the value of thesouthWestrecord component.- Returns:
- the value of the
southWestrecord component
-