@Override
public int compareTo(Object o)
{
Vector3 vector3 = (Vector3) o;
if (x == vector3.getX() && y == vector3.getY() && z == vector3.getZ())
return 0;
else return -1;
}
public class Vector3 {
private final int x;
private final int y;
private final int z;
public Vector3(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
public int getZ() {
return z;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Vector3 vector3 = (Vector3) o;
return x == vector3.getX() &&
y == vector3.getY() &&
z == vector3.getZ();
}
@Override
public int hashCode() {
return Objects.hash(x, y, z);
}
}