Added clone() implementation to support the ThrustCurveMotor copy constructor. Added serialVersionUID constant from the previous implementation to provide backwards compatibility with serialzied data in the android database.
This commit is contained in:
parent
34a5c097b7
commit
672239535a
@ -12,9 +12,12 @@ import net.sf.openrocket.startup.Application;
|
||||
*
|
||||
* @author Sampo Niskanen <sampo.niskanen@iki.fi>
|
||||
*/
|
||||
public final class Coordinate implements Serializable {
|
||||
public final class Coordinate implements Cloneable, Serializable {
|
||||
private static final LogHelper log = Application.getLogger();
|
||||
|
||||
// Defined for backwards compatibility after adding clone().
|
||||
static final long serialVersionUID = 585574649794259293L;
|
||||
|
||||
//////// Debug section
|
||||
/*
|
||||
* Debugging info. If openrocket.debug.coordinatecount is defined, a line is
|
||||
@ -68,8 +71,6 @@ public final class Coordinate implements Serializable {
|
||||
private double length = -1; /* Cached when calculated */
|
||||
|
||||
|
||||
|
||||
|
||||
public Coordinate() {
|
||||
this(0, 0, 0, 0);
|
||||
}
|
||||
@ -316,5 +317,9 @@ public final class Coordinate implements Serializable {
|
||||
return String.format("(%.3f,%.3f,%.3f)", x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Coordinate clone() {
|
||||
return new Coordinate( this.x, this.y, this.z, this.weight );
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user