Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #12448
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail |
|---|---|
| From | Lew <noone@lewscanon.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Additional logging questions |
| Date | Mon, 27 Feb 2012 12:32:30 -0800 |
| Organization | albasani.net |
| Lines | 22 |
| Message-ID | <jigp8t$ejo$2@news.albasani.net> (permalink) |
| References | <XnsA005D74257FB0jpnasty@94.75.214.39> <4f4ae583$0$281$14726298@news.sunsite.dk> <XnsA005ED51BFCF7jpnasty@94.75.214.39> <jif6ua$3cm$1@news.albasani.net> <XnsA0069221E7830jpnasty@94.75.214.39> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.albasani.net 4VmFQN+RjZAJtl6NFy8jcKLr6bpO+fxNAJFscc/bz0Xx4xn7UC3xTo/RAwDfiMWLPng32wGOdJNfD3KUNHfDDhH0xNGHeX519qw0BnqlPTWpflavKRK4EdkTZXyuSS3L |
| NNTP-Posting-Date | Mon, 27 Feb 2012 20:32:29 +0000 (UTC) |
| Injection-Info | news.albasani.net; logging-data="SFzk7YEO1N6je3yZEsXjHrthnCYZRCt5T1hnA69jE29JZer+oRIBxLr0IgMxYsle8xD7bwYPlvFjlwf5aRQyQTaUVr33FtkPKJesxKQKcmgrLnEyIXB+yWIoVkJobS+1"; mail-complaints-to="abuse@albasani.net" |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 |
| In-Reply-To | <XnsA0069221E7830jpnasty@94.75.214.39> |
| Cancel-Lock | sha1:lcvLdHymYnL/ZqbcV1lLz9Re+gE= |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:12448 |
Show key headers only | View raw
On 02/27/2012 11:14 AM, Novice wrote: > I don't touch hashCode(), equals() or compareTo() very often at all. Or > toString() either for that matter. But overriding hashCode() and equals() > solved a big problem for me recently. I was writing a holder class that > contained three fields, a table name, a row number and a column number, > as a key for a hash map and then storing the column width in the value > portion of the map. But when I tried to look up a given combination of > table name, row number and column number I was never finding values that > I knew were there. I googled and found out that I needed to revise > hashCode() and equals() and rougly what those changes needed to be and > then my lookups went fine. But I didn't touch compareTo(). Hmm, maybe I > need to revisit that and make sure it doesn't need some tweaking too.... Read the Javadocs for those methods. 'compareTo()' is not universal, being present only in instances of 'Comparable<T>'. -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Additional logging questions Novice <novice@example..com> - 2012-02-27 02:02 +0000
Re: Additional logging questions Arne Vajhøj <arne@vajhoej.dk> - 2012-02-26 21:08 -0500
Re: Additional logging questions Novice <novice@example..com> - 2012-02-27 04:12 +0000
Re: Additional logging questions Lew <noone@lewscanon.com> - 2012-02-26 22:13 -0800
Re: Additional logging questions Novice <novice@example..com> - 2012-02-27 19:14 +0000
Re: Additional logging questions Lew <noone@lewscanon.com> - 2012-02-27 12:32 -0800
Re: Additional logging questions Lew <noone@lewscanon.com> - 2012-02-27 13:06 -0800
Re: Additional logging questions Novice <novice@example..com> - 2012-02-28 01:48 +0000
Re: Additional logging questions Arne Vajhøj <arne@vajhoej.dk> - 2012-02-27 20:57 -0500
Re: Additional logging questions Lew <noone@lewscanon.com> - 2012-02-27 23:51 -0800
Re: Additional logging questions Arne Vajhøj <arne@vajhoej.dk> - 2012-02-27 20:50 -0500
Re: Additional logging questions Lew <noone@lewscanon.com> - 2012-02-27 23:57 -0800
Re: Additional logging questions Arne Vajhøj <arne@vajhoej.dk> - 2012-02-27 20:45 -0500
Re: Additional logging questions Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-02-28 01:52 -0600
Re: Additional logging questions Arne Vajhøj <arne@vajhoej.dk> - 2012-02-28 17:20 -0500
Re: Additional logging questions Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-02-28 20:26 -0400
Re: Additional logging questions Arne Vajhøj <arne@vajhoej.dk> - 2012-02-27 20:34 -0500
Re: Additional logging questions Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-02-27 12:36 -0800
Re: Additional logging questions Novice <novice@example..com> - 2012-02-28 01:43 +0000
csiph-web