|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.divbyzero.gpx.TrackSegment
public class TrackSegment
Track segment of a GPS track
A segment consists of an arbitrary number of way points. Segments have a length, can be queried for elevations and for the points in time when the segment was entered and left during a track recording.
Constructor Summary | |
---|---|
TrackSegment()
|
Method Summary | |
---|---|
void |
addWaypoint(Waypoint waypoint)
Adds a new way point to the segment. |
double |
cumulativeAscent()
Calculates the total ascent in the segment. |
double |
cumulativeDescent()
Calculates the total descent in the segment. |
Date |
endTime()
Returns the point in time when the segment was left |
ArrayList<Waypoint> |
getWaypoints()
Returns the way points of which the segment consists. |
double |
length()
Calculates the length of the track segment |
Date |
startingTime()
Returns the point in time when the segment was entered |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TrackSegment()
Method Detail |
---|
public void addWaypoint(Waypoint waypoint)
This method is used for extending a track segment by another way point. The way point is added at the segment's end.
waypoint
- the way point to be added to the segmentpublic ArrayList<Waypoint> getWaypoints()
This method returns a list of the way points that make up the segment. They are returned in the order that they were added, i.e. the way point at which the segments start is at position 0 while the way point where the segment ends is at the last position of the list.
public double length()
length
in interface Measurable
public double cumulativeAscent()
The total ascent of the segment is calculated by comparing each of the segment's way point with their predecessors. If the elevation of a way point is higher than the elevation of the predecessor, the total ascent is increased accordingly.
cumulativeAscent
in interface Measurable
cumulativeDescent()
public double cumulativeDescent()
The total descent of the segment is calculated by comparing each of the segment's way point with their predecessors. If the elevation of a way point is lower than the elevation of the predecessor, the total descent is increased accordingly.
cumulativeDescent
in interface Measurable
cumulativeAscent()
public Date startingTime()
Usually this is the time stamp of the way point that was added first to the segment.
startingTime
in interface Measurable
endTime()
public Date endTime()
Usually this is the time stamp of the way point that was added last to the segment.
endTime
in interface Measurable
endTime()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |