harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Kishenko" <dkishe...@gmail.com>
Subject Re: [optimization] Algorithmic tricks
Date Thu, 27 Jul 2006 10:39:37 GMT
2006/7/27, Ivanov, Alexey A <alexey.a.ivanov@intel.com>:
> It can handle Objects and uses object.hashCode().
Yep, HashCode has been already doing this.

> combine() performs the calculations. append() is a convenience method
> that returns the object it was called upon, so that your example can be
> re-written as follows:
>
>     public int hashCode() {
>        return new HashCode().append(m00)
>                             .append(m01)
>                                 .append(m02)
>                                 .append(m10)
>                                 .append(m11)
>                                 .append(m12)
>                             .hashCode();
>    }
>
> It's like StringBuffer.append().
Thanks, I understad the author's idea. It has something common with
Krzysztof's mehtod

return Arrays.hashCode(new Object[] {x, y, name});


-- 
Denis M. Kishenko
Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message