You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sven Rathgeber (JIRA)" <ji...@apache.org> on 2019/03/13 10:07:00 UTC
[jira] [Comment Edited] (GEOMETRY-29) Plane API cleanup
[ https://issues.apache.org/jira/browse/GEOMETRY-29?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16791523#comment-16791523 ]
Sven Rathgeber edited comment on GEOMETRY-29 at 3/13/19 10:06 AM:
------------------------------------------------------------------
{quote}add {{equals}}, {{hashCode}} methods.
{quote}
hmm, what do you picture here ? .... double comparison ..., precisionContext
This one, does not make sense to me:
{code:java}
@Override
public int hashCode() {
return Objects.hash(origin, originOffset, u, v, w);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Plane other = (Plane) obj;
return Objects.equals(origin, other.origin)
&& Double.doubleToLongBits(originOffset) == Double.doubleToLongBits(other.originOffset)
&& Objects.equals(u, other.u) && Objects.equals(v, other.v) && Objects.equals(w, other.w);
}{code}
was (Author: rathgeber):
{quote}add {{equals}}, {{hashCode}} methods.
{quote}
hmm, what do you picture here ? .... double comparison ..., precisionContext
> Plane API cleanup
> -----------------
>
> Key: GEOMETRY-29
> URL: https://issues.apache.org/jira/browse/GEOMETRY-29
> Project: Apache Commons Geometry
> Issue Type: Improvement
> Reporter: Matt Juntunen
> Priority: Major
>
> The following changes should be made to the {{o.a.c.g.euclidean.threed.Plane}} class:
> * make the class immutable
> * use well-named factory methods instead of constructor overloads
> * provide a factory method to create a plane with user-supplied {{u}} and {{v}} axes. The current implementation allows the normal to be provided but chooses its own planar axes (see {{setFrame}}).
> * add {{equals}}, {{hashCode}}, and {{toString}} methods.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)