Autopsy  4.19.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
CityRecord.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
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.autopsy.datasourcesummary.datamodel;
20 
21 import java.util.Objects;
23 
27 public class CityRecord extends KdTree.XYZPoint {
28 
29  private final String cityName;
30  private final String country;
31  private final String state;
32 
42  CityRecord(String cityName, String state, String country, double latitude, double longitude) {
43  super(latitude, longitude);
44  this.cityName = cityName;
45  this.state = state;
46  this.country = country;
47  }
48 
52  public String getCityName() {
53  return cityName;
54  }
55 
59  public String getState() {
60  return state;
61  }
62 
66  public String getCountry() {
67  return country;
68  }
69 
73  public double getLatitude() {
74  return getY();
75  }
76 
80  public double getLongitude() {
81  return getX();
82  }
83 
84  @Override
85  public int hashCode() {
86  int hash = super.hashCode();
87  hash = 37 * hash + Objects.hashCode(this.cityName);
88  hash = 37 * hash + Objects.hashCode(this.country);
89  return hash;
90  }
91 
92  @Override
93  public boolean equals(Object obj) {
94  if (this == obj) {
95  return true;
96  }
97  if (obj == null) {
98  return false;
99  }
100  if (getClass() != obj.getClass()) {
101  return false;
102  }
103  final CityRecord other = (CityRecord) obj;
104  if (!Objects.equals(this.cityName, other.cityName)) {
105  return false;
106  }
107  if (!Objects.equals(this.country, other.country)) {
108  return false;
109  }
110  return super.equals(obj);
111  }
112 
113  @Override
114  public String toString() {
115  return "CityRecord{" + "cityName=" + cityName + ", country=" + country + ", lat=" + getX() + ", lng=" + getY() + '}';
116  }
117 
118 }

Copyright © 2012-2021 Basis Technology. Generated on: Fri Aug 6 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.