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