Commit 32541a7c authored by Julian Zobel's avatar Julian Zobel
Browse files

Removed public settings of position timestamp, cloning now sets the timestamp...

Removed public settings of position timestamp, cloning now sets the timestamp form the cloned position.
parent ef0afde5
...@@ -107,6 +107,7 @@ public class PositionVector implements Location { ...@@ -107,6 +107,7 @@ public class PositionVector implements Location {
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(); this.created = Time.getCurrentTime();
} }
...@@ -161,7 +162,9 @@ public class PositionVector implements Location { ...@@ -161,7 +162,9 @@ 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!
*/ */
return new PositionVector(this); // use clone constructor PositionVector clone = new PositionVector(this); // use clone constructor
clone.setTimestamp(this.created);
return clone;
} }
...@@ -554,15 +557,11 @@ public class PositionVector implements Location { ...@@ -554,15 +557,11 @@ public class PositionVector implements Location {
@Override @Override
public long getAgeOfLocation() { public long getAgeOfLocation() {
return Time.getCurrentTime() - created; return Time.getCurrentTime() - created;
} }
/**
* private void setTimestamp(long locationTimestamp) {
* @param ageOfLocation the ageOfLocation to set this.created = locationTimestamp;
*/
public void setAgeofLocation(long ageOfLocation) {
this.created = ageOfLocation;
} }
@Override @Override
......
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