19 package org.sleuthkit.datamodel.blackboardutils.attributes;
21 import com.google.gson.annotations.SerializedName;
22 import java.util.ArrayList;
23 import java.util.Iterator;
24 import java.util.List;
25 import java.util.stream.Collectors;
40 private final List<TrackPoint> pointList;
46 pointList =
new ArrayList<>();
55 if (trackPoint == null) {
56 throw new IllegalArgumentException(
"addPoint was passed a null track point");
59 pointList.add(trackPoint);
64 return pointList.iterator();
73 return pointList.isEmpty();
84 List<TrackPoint> orderedPoints = getTimeOrderedPoints();
85 if (orderedPoints != null) {
87 if (point.getTimeStamp() != null) {
88 return point.getTimeStamp();
103 List<TrackPoint> orderedPoints = getTimeOrderedPoints();
104 if (orderedPoints != null) {
105 for (
int index = orderedPoints.size() - 1; index >= 0; index--) {
121 private List<TrackPoint> getTimeOrderedPoints() {
122 return pointList.stream().sorted().collect(Collectors.toCollection(ArrayList::new));
131 @SerializedName(
"TSK_GEO_VELOCITY")
132 private final Double velocity;
133 @SerializedName(
"TSK_DISTANCE_FROM_HOMEPOINT")
134 private final Double distanceFromHomePoint;
135 @SerializedName(
"TSK_DISTANCE_TRAVELED")
136 private final Double distanceTraveled;
137 @SerializedName(
"TSK_DATETIME")
138 private final Long timestamp;
168 Double distanceFromHomePoint,
169 Double distanceTraveled,
171 super(latitude, longitude, altitude, name);
172 this.velocity = velocity;
173 this.distanceFromHomePoint = distanceFromHomePoint;
174 this.distanceTraveled = distanceTraveled;
175 this.timestamp = timestamp;
195 return distanceFromHomePoint;
205 return distanceTraveled;
222 if (timestamp == null) {
223 if (otherTimeStamp != null) {
228 }
else if (timestamp != null && otherTimeStamp == null) {
TrackPoint(Double latitude, Double longitude, Double altitude, String name, Double velocity, Double distanceFromHomePoint, Double distanceTraveled, Long timestamp)
Iterator< TrackPoint > iterator()
Double getDistanceTraveled()
int compareTo(TrackPoint otherTP)
Double getDistanceFromHomePoint()
void addPoint(TrackPoint trackPoint)