Sleuth Kit Java Bindings (JNI)  4.12.1
Java bindings for using The Sleuth Kit
GeoAreaPoints.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 
36 public class GeoAreaPoints implements Iterable<GeoAreaPoints.AreaPoint> {
37 
38  private final List<AreaPoint> points;
39 
43  public GeoAreaPoints() {
44  points = new ArrayList<>();
45  }
46 
52  public void addPoint(AreaPoint areaPoint) {
53  if (areaPoint == null) {
54  throw new IllegalArgumentException("addPoint was passed a null waypoint");
55  }
56 
57  points.add(areaPoint);
58  }
59 
65  public boolean isEmpty() {
66  return points.isEmpty();
67  }
68 
69  @Override
70  public Iterator<AreaPoint> iterator() {
71  return points.iterator();
72  }
73 
79  public static class AreaPoint {
80 
81  @SerializedName("TSK_GEO_LATITUDE")
82  private final Double latitude;
83  @SerializedName("TSK_GEO_LONGITUDE")
84  private final Double longitude;
85 
92  public AreaPoint(Double latitude, Double longitude) {
93  if (latitude == null) {
94  throw new IllegalArgumentException("Constructor was passed null latitude");
95  }
96 
97  if (longitude == null) {
98  throw new IllegalArgumentException("Constructor was passed null longitude");
99  }
100 
101  this.latitude = latitude;
102  this.longitude = longitude;
103  }
104 
110  public Double getLatitude() {
111  return latitude;
112  }
113 
119  public Double getLongitude() {
120  return longitude;
121  }
122  }
123 }

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