Skip to content
Permalink
Browse files

Made comparable

  • Loading branch information...
rubendel committed Jun 6, 2019
1 parent 74818c4 commit 0d4449bd29334793aae348a02fb324d7b7d5fcf6
Showing with 16 additions and 2 deletions.
  1. +16 −2 PluginBase/src/org/bimserver/geometry/Vector3D.java
@@ -18,7 +18,7 @@
* {@literal<http://www.gnu.org/licenses/>}.
*****************************************************************************/

public class Vector3D extends Vector0D {
public class Vector3D extends Vector0D implements Comparable<Vector3D> {

private double x;
private double y;
@@ -69,4 +69,18 @@ public double get(int index) {
}
return 0;
}
}

@Override
public int compareTo(Vector3D o) {
if (o.x != x) {
return Double.compare(o.x, x);
}
if (o.y != y) {
return Double.compare(o.y, y);
}
if (o.z != z) {
return Double.compare(o.z, z);
}
return 0;
}
}

0 comments on commit 0d4449b

Please sign in to comment.
You can’t perform that action at this time.