Re: [Jts-topo-suite-user] Any interest in fixing bugs?
Brought to you by:
dr_jts
From: Martin D. <mtn...@gm...> - 2011-01-27 21:07:25
|
The net answers the question about when equals(Object) gets called: http://stackoverflow.com/questions/309892/when-overriding-equals-in-java-why-does-it-not-work-to-use-a-parameter-other-tha So it sounds as if providing equals(Object) will do the right thing when used with Collections. It should be fairly easy to provide the following: equals(Object) - delegating to equalsExact when Object is a Geometry hashcode() - implemented by hashing the numbers in the Envelope It would be nice to confirm that this scheme will work in practice. One way to do this is to create a Geometry wrapper class providing the above semantics. David, can you do this in your project and confirm that this gives the behaviour that you need? On Thu, Jan 27, 2011 at 12:45 PM, Martin Davis <mtn...@gm...> wrote: > > > > Hmmm... providing equals(Geometry) sounds like a clever way out of this > mess. But how does Java resolve the overloaded method to use? Is it always > possible to know that equals (Object) will be used where needed (e.g. in > particular, within Collection classes)? > > |