Commit c8937d62 authored by Julian Zobel's avatar Julian Zobel
Browse files

minor changes

parent f9b5d672
...@@ -72,8 +72,9 @@ public class PositionVector implements Location { ...@@ -72,8 +72,9 @@ public class PositionVector implements Location {
private double[] values; private double[] values;
private double accuracy = -1; private double accuracy = -1;
/** /**
* Timestamp with time when created * Timestamp of creation
*/ */
private long created; private long created;
...@@ -106,9 +107,7 @@ public class PositionVector implements Location { ...@@ -106,9 +107,7 @@ public class PositionVector implements Location {
this(vec.getDimensions()); this(vec.getDimensions());
for (int i = 0; i < vec.getDimensions(); i++) { for (int i = 0; i < vec.getDimensions(); i++) {
setEntry(i, vec.getEntry(i)); setEntry(i, vec.getEntry(i));
} }
this.created = Time.getCurrentTime();
} }
public PositionVector(double longitudeOrX, double latitudeOrY) { public PositionVector(double longitudeOrX, double latitudeOrY) {
...@@ -116,7 +115,6 @@ public class PositionVector implements Location { ...@@ -116,7 +115,6 @@ public class PositionVector implements Location {
this.setLatitudeOrY(latitudeOrY); this.setLatitudeOrY(latitudeOrY);
this.setLongitudeOrX(longitudeOrX); this.setLongitudeOrX(longitudeOrX);
this.setAltitude(0); this.setAltitude(0);
this.created = Time.getCurrentTime();
} }
public PositionVector(double longitudeOrX, double latitudeOrY, double altitude) { public PositionVector(double longitudeOrX, double latitudeOrY, double altitude) {
...@@ -124,7 +122,6 @@ public class PositionVector implements Location { ...@@ -124,7 +122,6 @@ public class PositionVector implements Location {
this.setLatitudeOrY(latitudeOrY); this.setLatitudeOrY(latitudeOrY);
this.setLongitudeOrX(longitudeOrX); this.setLongitudeOrX(longitudeOrX);
this.setAltitude(altitude); this.setAltitude(altitude);
this.created = Time.getCurrentTime();
} }
public PositionVector(Location location) { public PositionVector(Location location) {
...@@ -154,7 +151,6 @@ public class PositionVector implements Location { ...@@ -154,7 +151,6 @@ public class PositionVector implements Location {
for (int i = 0; i < values.length; i++) { for (int i = 0; i < values.length; i++) {
setEntry(i, values[i]); setEntry(i, values[i]);
} }
this.created = Time.getCurrentTime();
} }
@Override @Override
...@@ -163,7 +159,7 @@ public class PositionVector implements Location { ...@@ -163,7 +159,7 @@ public class PositionVector implements Location {
* If you extend Position Vector, make sure to overwrite this method! * If you extend Position Vector, make sure to overwrite this method!
*/ */
PositionVector clone = new PositionVector(this); // use clone constructor PositionVector clone = new PositionVector(this); // use clone constructor
clone.setTimestamp(this.created); clone.created = this.created;
return clone; return clone;
} }
...@@ -559,11 +555,7 @@ public class PositionVector implements Location { ...@@ -559,11 +555,7 @@ public class PositionVector implements Location {
public long getAgeOfLocation() { public long getAgeOfLocation() {
return Time.getCurrentTime() - created; return Time.getCurrentTime() - created;
} }
private void setTimestamp(long locationTimestamp) {
this.created = locationTimestamp;
}
@Override @Override
public double distanceTo(Location dest) { public double distanceTo(Location dest) {
if (dest instanceof PositionVector) { if (dest instanceof PositionVector) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment