Package slash.navigation.common
Class SimpleNavigationPosition
java.lang.Object
slash.navigation.common.SimpleNavigationPosition
- All Implemented Interfaces:
NavigationPosition
- Direct Known Subclasses:
SimpleCategorizedNavigationPosition
A navigation position that supports just longitude, latitude, elevation, description and time.
- Author:
- Christian Pesch
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleNavigationPosition(Double longitude, Double latitude) SimpleNavigationPosition(Double longitude, Double latitude, Double elevation, String description) SimpleNavigationPosition(Double longitude, Double latitude, Double elevation, String description, CompactCalendar time) SimpleNavigationPosition(Double longitude, Double latitude, CompactCalendar time) -
Method Summary
Modifier and TypeMethodDescriptioncalculateAngle(NavigationPosition other) Calculate the angle in degree between this and the other position.Calculate the distance in meters between this and the other position.Calculate the elevation in meter between this and the other position.calculateOrthogonalDistance(NavigationPosition pointA, NavigationPosition pointB) Calculate the orthogonal distance of this position to the line from pointA to pointB, supposed you are proceeding on a great circle route from A to B and end up at D, perhaps ending off course.calculateSpeed(NavigationPosition other) Calculate the average speed in kilometers per hour between this and the other position.calculateTime(NavigationPosition other) Calculate the time in milliseconds between this and the other position.booleanReturn the elevation in meters above sea levelReturn the latitude in the WGS84 coordinate systemReturn the longitude in the WGS84 coordinate systemgetSpeed()Return the speed in kilometers per hourgetTime()Return the date and time in UTC time zonebooleaninthashCode()booleanhasTime()voidsetDescription(String description) voidsetElevation(Double elevation) voidsetLatitude(Double latitude) voidsetLongitude(Double longitude) voidvoidsetStartDate(CompactCalendar startDate) Set the day/month/year-offset for date-less, time-only positionsvoidsetTime(CompactCalendar time) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface slash.navigation.common.NavigationPosition
isStartsNewSegment
-
Constructor Details
-
SimpleNavigationPosition
public SimpleNavigationPosition(Double longitude, Double latitude, Double elevation, String description, CompactCalendar time) -
SimpleNavigationPosition
-
SimpleNavigationPosition
-
SimpleNavigationPosition
-
-
Method Details
-
getLongitude
Description copied from interface:NavigationPositionReturn the longitude in the WGS84 coordinate system- Specified by:
getLongitudein interfaceNavigationPosition- Returns:
- the longitude in the WGS84 coordinate system
-
setLongitude
- Specified by:
setLongitudein interfaceNavigationPosition
-
getLatitude
Description copied from interface:NavigationPositionReturn the latitude in the WGS84 coordinate system- Specified by:
getLatitudein interfaceNavigationPosition- Returns:
- the latitude in the WGS84 coordinate system
-
setLatitude
- Specified by:
setLatitudein interfaceNavigationPosition
-
hasCoordinates
public boolean hasCoordinates()- Specified by:
hasCoordinatesin interfaceNavigationPosition
-
getElevation
Description copied from interface:NavigationPositionReturn the elevation in meters above sea level- Specified by:
getElevationin interfaceNavigationPosition- Returns:
- the elevation in meters above sea level
-
setElevation
- Specified by:
setElevationin interfaceNavigationPosition
-
getTime
Description copied from interface:NavigationPositionReturn the date and time in UTC time zone- Specified by:
getTimein interfaceNavigationPosition- Returns:
- the date and time in UTC time zone
-
setTime
- Specified by:
setTimein interfaceNavigationPosition
-
hasTime
public boolean hasTime()- Specified by:
hasTimein interfaceNavigationPosition
-
getSpeed
Description copied from interface:NavigationPositionReturn the speed in kilometers per hour- Specified by:
getSpeedin interfaceNavigationPosition- Returns:
- the speed in kilometers per hour
-
setSpeed
- Specified by:
setSpeedin interfaceNavigationPosition
-
getDescription
- Specified by:
getDescriptionin interfaceNavigationPosition
-
setDescription
- Specified by:
setDescriptionin interfaceNavigationPosition
-
setStartDate
Description copied from interface:NavigationPositionSet the day/month/year-offset for date-less, time-only positions- Specified by:
setStartDatein interfaceNavigationPosition- Parameters:
startDate- the day/month/year-offset
-
equals
-
hashCode
public int hashCode() -
toString
-