File: PointSequence.java

package info (click to toggle)
gpsprune 26.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,824 kB
  • sloc: java: 52,154; sh: 25; makefile: 21; python: 15
file content (42 lines) | stat: -rw-r--r-- 781 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package tim.prune.function.comparesegments;

import java.util.ArrayList;
import java.util.List;

import tim.prune.data.Timestamp;

/**
 * Hold a sequence of PointData objects
 * and link them forwards to each other
 */
public class PointSequence
{
	private final ArrayList<PointData> _points = new ArrayList<>();
	private PointData _lastPoint = null;

	void addPoint(PointData inPointData)
	{
		_points.add(inPointData);
		_lastPoint = inPointData;
	}

	int getNumPoints() {
		return _points.size();
	}

	PointData getFirstPoint() {
		return _points.get(0);
	}

	PointData getLastPoint() {
		return _lastPoint;
	}

	Timestamp getFirstTimestamp() {
		return _points.isEmpty() ? null : getFirstPoint()._point.getTimestamp();
	}

	List<PointData> getPoints() {
		return _points;
	}
}