Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!r2g2000prh.googlegroups.com!not-for-mail From: dhtml Newsgroups: comp.lang.javascript,comp.lang.java.programmer Subject: Re: Objects comparaison ? Date: Sun, 16 Oct 2011 09:05:34 -0700 (PDT) Organization: http://groups.google.com Lines: 50 Message-ID: References: <1k93ek2.1xghqcy1upjvv5N%unbewusst.sein@fai.invalid> <1783522.fYvYJRLvp5@PointedEars.de> <1411612.7OFYzboFZ6@PointedEars.de> <2326223.jLKWLtnpvF@PointedEars.de> <2065619.34vx2sxqLb@PointedEars.de> <2995463.SPkdTlGXAF@PointedEars.de> NNTP-Posting-Host: 68.127.106.7 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1318789547 23314 127.0.0.1 (16 Oct 2011 18:25:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 16 Oct 2011 18:25:47 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r2g2000prh.googlegroups.com; posting-host=68.127.106.7; posting-account=1DnWogoAAAAbQZrDmIPCN9Y8IXuDIdgS User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20100101 Firefox/7.0.1,gzip(gfe) Xref: x330-a1.tempe.blueboxinc.net comp.lang.javascript:7482 comp.lang.java.programmer:8869 On Oct 16, 2:41=A0am, Thomas 'PointedEars' Lahn wrote: > dhtml wrote: > > Thomas 'PointedEars' Lahn wrote: > >> dhtml wrote: > >> > Thomas 'PointedEars' Lahn wrote: > >> >> dhtml wrote: > >> >> > Thomas 'PointedEars' Lahn wrote: > >> >> >> Jukka K. Korpela wrote: > >> >> >> > 13.10.2011 22:21, Thomas 'PointedEars' Lahn wrote: > >> >> >> >> Java's equals() method [=96 which exists precisely for that > >> >> >> >> purpose =96 should provide a good start for an implementation= in > >> >> >> >> ECMAScript.] > > >> >> > Java `Object.equals` does nothing more than use Java's =3D=3D whi= ch is > >> >> > analagous to JavaScript's =3D=3D=3D. > > >> >> I did not write `Object.equals()', if you cared to notice. > > >> > Which Java equals() method did you mean? > > >> Context matters. =A0By "should provide a good *start* for an implement= ation > >> *in* ECMAScript" I was referring to the *concept* of Java's > >> Object.equals() method, a method which is *overriden* by subclasses. > > > Not necessarily. > > Most definitely it is. =A0There is String.equals() and, say, Boolean.equa= ls(). =A0 > Both are subclasses of Object and override Object.equals(). > And there is also java.lang CharSequence and StringBuffer, which do not. And also: > > Object `equals` method may be overridden but this is often neglected by > > programmers. Java guidelines for how to override `equals` are applicabl= e > > here. > > ACK > So there really isn't a Java equals method that applies to the OP. There is Java's guidelines though, to be reflexive, symmetric, transitive, and consistent. An `equals` method should also have no observable side effects. -- Garrett