aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/Destination.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/Destination.java')
-rw-r--r--main/src/cgeo/geocaching/Destination.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/Destination.java b/main/src/cgeo/geocaching/Destination.java
new file mode 100644
index 0000000..441e959
--- /dev/null
+++ b/main/src/cgeo/geocaching/Destination.java
@@ -0,0 +1,44 @@
+package cgeo.geocaching;
+
+import cgeo.geocaching.geopoint.Geopoint;
+
+public final class Destination implements ICoordinates {
+
+ final private long id;
+ final private long date;
+ final private Geopoint coords;
+
+ public Destination(long id, long date, final Geopoint coords) {
+ this.id = id;
+ this.date = date;
+ this.coords = coords;
+ }
+
+ public Destination(final Geopoint coords) {
+ this(0, System.currentTimeMillis(), coords);
+ }
+
+ public long getDate() {
+ return date;
+ }
+
+ @Override
+ public Geopoint getCoords() {
+ return coords;
+ }
+
+ @Override
+ public int hashCode() {
+ return coords.hashCode();
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return obj != null && obj instanceof Destination && ((Destination) obj).coords.equals(coords);
+ }
+
+ public long getId() {
+ return id;
+ }
+
+}