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 doublePositions altitude - height above sea level.private static final doubleEpsilon for double compare.private final doublePositions latitude specifies the north–south position of a point on the Earth's surface.private final doublePositions longitude specifies the east–west position of a point on the Earth's surface.private static final StringPosition separator. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateWGS84Position(double latitude, double longitude, double altitude) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(WGS84Position obj) Compare with another object.booleanIs equal with another object.doubleGet altitude.doubleGet latitude.doubleGet longitude.inthashCode()Calculate hash code.static WGS84Positionof(double latitude, double longitude, double altitude) WGS84Position factory.static WGS84PositionWGS84Position 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:
stringValuein 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:
compareToin interfaceComparable<WGS84Position>- Parameters:
obj- Object to compare with- Returns:
- 0: equal; 1: greater; -1: smaller
- See Also:
-