Sleuth Kit Java Bindings (JNI)  4.9.0
Java bindings for using The Sleuth Kit
GeoWaypoints.java
Go to the documentation of this file.
1 /*
2  * Sleuth Kit Data Model
3  *
4  * Copyright 2020 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.datamodel.blackboardutils.attributes;
20 
21 import com.google.gson.annotations.SerializedName;
22 import java.util.ArrayList;
23 import java.util.Iterator;
24 import java.util.List;
25 
37 public class GeoWaypoints implements Iterable<GeoWaypoints.Waypoint> {
38 
39  private final List<Waypoint> points;
40 
44  public GeoWaypoints() {
45  points = new ArrayList<>();
46  }
47 
53  public void addPoint(Waypoint wayPoint) {
54  if (wayPoint == null) {
55  throw new IllegalArgumentException("addPoint was passed a null waypoint");
56  }
57 
58  points.add(wayPoint);
59  }
60 
66  public boolean isEmpty() {
67  return points.isEmpty();
68  }
69 
70  @Override
71  public Iterator<Waypoint> iterator() {
72  return points.iterator();
73  }
74 
80  public static class Waypoint {
81 
82  @SerializedName("TSK_GEO_LATITUDE")
83  private final Double latitude;
84  @SerializedName("TSK_GEO_LONGITUDE")
85  private final Double longitude;
86  @SerializedName("TSK_GEO_ALTITUDE")
87  private final Double altitude;
88  @SerializedName("TSK_NAME")
89  private final String name;
90 
101  public Waypoint(Double latitude, Double longitude, Double altitude, String name) {
102  if (latitude == null) {
103  throw new IllegalArgumentException("Constructor was passed null latitude");
104  }
105 
106  if (longitude == null) {
107  throw new IllegalArgumentException("Constructor was passed null longitude");
108  }
109 
110  this.latitude = latitude;
111  this.longitude = longitude;
112  this.altitude = altitude;
113  this.name = name;
114  }
115 
121  public Double getLatitude() {
122  return latitude;
123  }
124 
130  public Double getLongitude() {
131  return longitude;
132  }
133 
139  public Double getAltitude() {
140  return altitude;
141  }
142 
148  public String getName() {
149  return name;
150  }
151  }
152 
153 }
Waypoint(Double latitude, Double longitude, Double altitude, String name)

Copyright © 2011-2020 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.