Newer
Older
import cz.fidentis.analyst.feature.api.IPosition;
import java.util.Objects;
* @author Jakub Kolman
public class FeaturePoint implements IPosition, Serializable {
private Point3d position;
private final FeaturePointType featurePointType;
*
* @param x Location x
* @param y Location y
* @param z Location z
* @param featurePointType Original type
*/
public FeaturePoint(double x, double y, double z, FeaturePointType featurePointType) {
this.position = new Point3d(x, y, z);
this.featurePointType = featurePointType;
public Point3d getPosition() {
return position;
public FeaturePointType getFeaturePointType() {
return featurePointType;
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@Override
public boolean equals(Object o) {
// self check
if (this == o) {
return true;
}
// null check
if (o == null) {
return false;
}
// type check and cast
if (getClass() != o.getClass()) {
return false;
}
FeaturePoint fp = (FeaturePoint) o;
// field comparison
return Objects.equals(position.x, fp.position.x)
&& Objects.equals(position.y, fp.position.y)
&& Objects.equals(position.z, fp.position.z)
&& Objects.equals(featurePointType.getCode(), fp.featurePointType.getCode())
&& Objects.equals(featurePointType.getInfo(), fp.featurePointType.getInfo())
&& Objects.equals(featurePointType.getName(), fp.featurePointType.getName())
&& Objects.equals(featurePointType.getType(), fp.featurePointType.getType());
}
/**
* generated hash code function
*
* @return
*/
@Override
public int hashCode() {
int hash = 5;
hash = 23 * hash + Objects.hashCode(this.position);
hash = 23 * hash + Objects.hashCode(this.featurePointType);
return hash;
}