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 {
private double[] values;
private double accuracy = -1;
/**
* Timestamp with time when created
* Timestamp of creation
*/
private long created;
......@@ -106,9 +107,7 @@ public class PositionVector implements Location {
this(vec.getDimensions());
for (int i = 0; i < vec.getDimensions(); i++) {
setEntry(i, vec.getEntry(i));
}
this.created = Time.getCurrentTime();
}
}
public PositionVector(double longitudeOrX, double latitudeOrY) {
......@@ -116,7 +115,6 @@ public class PositionVector implements Location {
this.setLatitudeOrY(latitudeOrY);
this.setLongitudeOrX(longitudeOrX);
this.setAltitude(0);
this.created = Time.getCurrentTime();
}
public PositionVector(double longitudeOrX, double latitudeOrY, double altitude) {
......@@ -124,7 +122,6 @@ public class PositionVector implements Location {
this.setLatitudeOrY(latitudeOrY);
this.setLongitudeOrX(longitudeOrX);
this.setAltitude(altitude);
this.created = Time.getCurrentTime();
}
public PositionVector(Location location) {
......@@ -154,7 +151,6 @@ public class PositionVector implements Location {
for (int i = 0; i < values.length; i++) {
setEntry(i, values[i]);
}
this.created = Time.getCurrentTime();
}
@Override
......@@ -163,7 +159,7 @@ public class PositionVector implements Location {
* If you extend Position Vector, make sure to overwrite this method!
*/
PositionVector clone = new PositionVector(this); // use clone constructor
clone.setTimestamp(this.created);
clone.created = this.created;
return clone;
}
......@@ -559,11 +555,7 @@ public class PositionVector implements Location {
public long getAgeOfLocation() {
return Time.getCurrentTime() - created;
}
private void setTimestamp(long locationTimestamp) {
this.created = locationTimestamp;
}
@Override
public double distanceTo(Location dest) {
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