equals () gerado pelo Eclipse: getOuterType ()?
Eu tenho classe simples Point com dois campos do tipodouble
. Eu pedi ao Eclipse 3.6 para gerarequals()
ehashCode()
por isso. oequals()
O método se parece com isso:
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Point other = (Point) obj;
if (!getOuterType().equals(other.getOuterType()))
return false;
if (Double.doubleToLongBits(x) != Double.doubleToLongBits(other.x))
return false;
if (Double.doubleToLongBits(y) != Double.doubleToLongBits(other.y))
return false;
return true;
}
E agetOuterType
se parece com isso:
private Point getOuterType() {
return Point.this;
}
Portanto, a questão é: qual é o objetivo degetOuterType().equals(other.getOuterType())
linha?