java.lang.Object
de.powerstat.validation.values.WGS84Position
- All Implemented Interfaces:
IValueObject
,Comparable<WGS84Position>
World geodetic system 1984 position.
Possibly DSGVO relevant.
TODO precision
TODO output formats
TODO Get address for position if possible
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final double
Positions altitude - height above sea level.private static final double
Epsilon for double compare.private final double
Positions latitude specifies the north–south position of a point on the Earth's surface.private final double
Positions longitude specifies the east–west position of a point on the Earth's surface.private static final String
Position separator. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
WGS84Position
(double latitude, double longitude, double altitude) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(WGS84Position obj) Compare with another object.boolean
Is equal with another object.double
Get altitude.double
Get latitude.double
Get longitude.int
hashCode()
Calculate hash code.static WGS84Position
of
(double latitude, double longitude, double altitude) WGS84Position factory.static WGS84Position
WGS84Position factory.Returns the value of this WGS84Position as a String.toString()
Returns the string representation of this WGS84Position.
-
Field Details
-
EPSILON
private static final double EPSILONEpsilon for double compare.- See Also:
-
SEPARATOR
Position separator.- See Also:
-
latitude
private final double latitudePositions latitude specifies the north–south position of a point on the Earth's surface. Ranges from 0° at the Equator to 90° (North or South) at the poles. -
longitude
private final double longitudePositions longitude specifies the east–west position of a point on the Earth's surface. The prime meridian, which passes near the Royal Observatory, Greenwich, England, is defined as 0° longitude by convention. Positive longitudes are east of the prime meridian, and negative ones are west. -
altitude
private final double altitudePositions altitude - height above sea level.
-
-
Constructor Details
-
WGS84Position
private WGS84Position(double latitude, double longitude, double altitude) Constructor.- Parameters:
latitude
- Positions latitude specifies the north–south position of a point on the Earth's surface. Ranges from 0° at the Equator to 90° (North or South) at the poles.longitude
- Positions longitude specifies the east–west position of a point on the Earth's surface. The prime meridian, which passes near the Royal Observatory, Greenwich, England, is defined as 0° longitude by convention. Positive longitudes are east of the prime meridian, and negative ones are west.altitude
- Positions altitude - height above sea level.
-
-
Method Details
-
of
WGS84Position factory.- Parameters:
latitude
- Positions latitude specifies the north–south position of a point on the Earth's surface. Ranges from 0° at the Equator to 90° (North or South) at the poles.longitude
- Positions longitude specifies the east–west position of a point on the Earth's surface. The prime meridian, which passes near the Royal Observatory, Greenwich, England, is defined as 0° longitude by convention. Positive longitudes are east of the prime meridian, and negative ones are west.altitude
- Positions altitude - height above sea level.- Returns:
- WGS84Position object
-
of
WGS84Position factory.- Parameters:
value
- latitude longitude altitude separated by one space- Returns:
- WGS84Position object
-
getLatitude
public double getLatitude()Get latitude.- Returns:
- Latitude
-
getLongitude
public double getLongitude()Get longitude.- Returns:
- Longitude
-
getAltitude
public double getAltitude()Get altitude.- Returns:
- Altitude
-
stringValue
Returns the value of this WGS84Position as a String.- Specified by:
stringValue
in interfaceIValueObject
- Returns:
- The value represented by this object after conversion to type String.
-
hashCode
public int hashCode()Calculate hash code. -
equals
Is equal with another object. -
toString
Returns the string representation of this WGS84Position. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "WGS84Position[latitude=0.0, longitude=0.0, altitude=0.0]" -
compareTo
Compare with another object.- Specified by:
compareTo
in interfaceComparable<WGS84Position>
- Parameters:
obj
- Object to compare with- Returns:
- 0: equal; 1: greater; -1: smaller
- See Also:
-