Need clarification on Object.equals.

G

Gene Wirchenko

On Wed, 19 Dec 2012 15:40:54 +0000, lipska the kat

[snip]
Well you still don't get it do you
I don't defend insulting behavior but sometimes flesh and blood can
stand just so much, lets try again. One question at a time.

Why not relax and enjoy the nice USENET?
You said

"My point is that while newbies do have a "allowed to post
stupid questions" card"

Who 'allows' them to post stupid questions.

Freedom of speech.
Do you understand the question

It's a very simple question, really it is. who is it ?
I really do want to know.

However, freedom of speech does not require the recipient to
listen or to take it seriously. It also allows the recipient to
reply.

Sincerely,

Gene Wirchenko
 
A

Arne Vajhøj

AbstractSet implements Set, so all its subclasses also implement Set.

That means they are bound by the Set contract for .equals, which treats
all classes that implement Set the same way. There might be a
performance advantage to overriding AbstractSet's .equals in some cases,
but its result would have to be preserved.

If the Set interface specify the behavior of equals, then testing for
type is not valid.

Testing for type may only make sense on domain classes and not
for container classes at all.
The right solution is, of course, the action the OP is already taking -
don't extend AbstractSet unless you really are implementing a Set, and
intend to follow the Set contract.

Yes.

Arne
 
J

Joshua Cranmer

If 'Joshua' has a problem with me let him be the one to speak.

If I feel I have nothing to add to a discourse, I won't say anything. I
also have this nasty habit of ignoring insults or responding to them (or
pretty much anything else) with humor.
 
F

FredK

On said:
On 12/19/2012 11:13 AM, FredK wrote: > On Tuesday, December 18, 2012 10:56:19 AM UTC-8, Peter Duniho wrote: >> On Tue, 18 Dec 2012 04:48:16 -0800, Roedy Green wrote: >>>> Node a = new Gate(); >>>> Monitor b = new Monitor(); >>>> System.out.println(a.equals(b)); // --> prints 'true' >>> Gate orone of its superclasses is implementing equals. >>And doing it incorrectly, I'd say. > > Why would you think it was done incorrectly? > For most classes, a.equals(b) is not the same as a==b. > Think about string: > string a = "abc"); > string b = new string(a); > Clearly a==b is false, but a.equals(b) is true. > > Usually the equals() method returns true if the internal state of both objects is the same. It is rather unusual to have objects of different classes considered equals. Your example is different. Arne

Which points out that the real issue is that you must define what you want equals() to mean. There may well be situations where two objects of different classes could be considered to be "equal" ( Consider a Square with side=2, and a (immutable) Rectangle with width=2 and length=2 )
 
G

Gene Wirchenko

Well in the real world nobody answers for me except me. I stand and fall
by my own decisions and am quite prepared to take the consequences of my
actions however harsh those consequences may be.

Not everyone has to do that.
However we are not in the real world are we. We are in a world where

Yes, we are. The idea that the Net is not part of the real world
is inane.

[snip]

Sincerely,

Gene Wirchenko
 
G

Gene Wirchenko

On Wed, 19 Dec 2012 15:40:54 +0000, lipska the kat
[snip]

However, freedom of speech does not require the recipient to
listen or to take it seriously. It also allows the recipient to
reply.

Oh a light in the darkness.

I couldn't agree more the important bit here of course is

It also allows the *recipient* to reply (my accent)

I have no problem with the recipient replying, what I object to is the
mass rounding on an individual by multiple aggressive responders
'standing up for' people who I am sure are well able to stand up for
themselves

THIS is unacceptable and I for one will not tolerate it any longer.

How are you going to do that?

Sincerely,

Gene Wirchenko
 
G

Gene Wirchenko

Never worried me before and it won't worry me in the future.
Unlike you and your rather sad little collection of puffed up self
important 'friends' I have the courage of my convictions.

It is too bad that so many of these convictions are not working
out very well for you. You have done an excellent job of antagonising
quite a few people here in a very short time.

[snip]

Sincerely,

Gene Wirchenko
 
G

Gene Wirchenko

On Wed, 19 Dec 2012 14:36:21 +0000, lipska the kat

[snip]
This is USENET, you don't own it, you don't have the right to tell
people what they can and cannot post, in fact you are just another
faceless whiner among so many faceless whiners.

You are presuming to tell him what he can post here. How is it
that your statement does not apply to you

Am I, I don't get that at all from my statement. I'm questioning his
authority to tell others what they can and can't post.

"...you do not have the right to tell..." is doing exactly that.
English can be a tricky language.

What I will not tolerate however is the 'ganging up' on unsuspecting
users. I can take it, in fact I find the discourse exhilarating, others
may be more badly affected.

Why not let them speak for themselves? You seem to think that we
should do that. Try applying it yourself.
If you think that sort of behaviour is acceptable then I'm afraid you
are part of the problem.

There was no big deal here until you made one.
I'm trying to put a name to this behaviour. When I do I'll make it quite
clear where I stand. (Yet again)

Like a broken record?

Sincerely,

Gene Wirchenko
 
L

Lew

lipska said:
Now I'm not normally driven to using bad language but
What the f**k is wrong with you people.

What the **** is wrong with /you/?
This is Usenet, not your private little universe.

People gave a perfectly reasonable answer to the question, and "ple..." got
their knickers in a twist.
I've noticed this a lot in various newsgroups that I have been
frequenting of late. People who are regular contributors get the idea
that foo.bar.baz newsgroup is their private domain and anyone who has
the temerity to post a question that doesn't meet their exacting
standards get flamed and scolded and told to stop whining.

Maybe the OP should not have whined, then.
I get told off but I have the skin of a Rhino and none of you silly
little jibes affect me or my life in any way whatsoever. Not everyone is
so unaffected.

They weren't "jibes", as you hope to convince us without evidence by the mere
use of the word. They were valid advice.'
Please think before you flame.

Physician, heal thyself.
Oh, and by the way, my flames are ALWAYS justified :)

As any troll would say, your disingenuous smiley-face notwithstanding.
 
S

Stefan Ram

Peter Duniho said:
If a person wants to write a private message, to which only that one
private recipient of the message may reply, then they should send the
message privately.

This is already the default:

void person( final Object object )
{ final Reply reply = object.message(); }

Now, only »object« will directly get the message,
and only »person« will directly get the reply.

If you want a public message, you might try something like:

void person( final Infrastructure infrastructure, final Object object )
{ final Reply reply = infrastructure.sendPublicly( object, new Message() ); }
Public messages grant the right of public comment.

void person( final Infrastructure infrastructure, final Object object )
{ final Reply reply = infrastructure.sendPublicly( object, new Message() );
final Comments comments = infrastructure.getPublicComments( reply ); }

»getPublicComments« might block your thread until
infrastructure.getMaxCommentWaitTime() seconds have
passed. See also: »Infrastructure#peekPublicComments«.

I hope that helps you with you project! (If you like
messages, you also might like to have a look at the
programming language Smalltalk.)
 
G

Gene Wirchenko

On 19/12/12 18:22, Gene Wirchenko wrote:
[snip]

Public messages grant the right of public comment.

Missing the point (again)

Actually, he has the point quite well. You do not appear to like
this though.
Oh dear, one really does have to make things very simple doesn't one.

Every time people like you send an aggressive message en-mass I will
stick my nose in. As you say public messages grant the right of public
comment.

Go ahead. Flip your bozo bit.
Get used to it.

We can outlast you easily.

Sincerely,

Gene Wirchenko
 
L

Lew

lipska said:
At last, confirmation of a cabal of self-important hypocrites ... as if
any were needed. That makes it all worthwhile ... I feel so happy I
think I may cut me a hunk of Stilton.

Oh, Paul, Paul, Paul.

Tsk. Tsk.
 
G

Gene Wirchenko

On 20/12/12 01:05, Peter Duniho wrote:
On Wed, 19 Dec 2012 18:49:21 +0000, lipska the kat wrote:

On 19/12/12 18:22, Gene Wirchenko wrote:
[snip]
Get used to it.

We can outlast you easily.

WE can outlast you ...

Yes. More than one person follows this newsgroup.
At last, confirmation of a cabal of self-important hypocrites ... as if
any were needed. That makes it all worthwhile ... I feel so happy I
think I may cut me a hunk of Stilton.

A conspiracy, huh?

Don't you have a world ending shortly to worry about?
I knew you'd slip up eventually. Suck it up Gene, get ready for a bumpy
ride.

Are you offering to play pony for me? I do not swing that way.

Sincerely,

Gene Wirchenko
 
P

Peter Dunihơ

On Thu, 20 Dec 2012 11:08:37 -0800, Lew wrote:

13> Newsgroups: comp.lang.java.programmer

13> Oh, Paul, Paul, Paul.

Who is "Paul", Bloch? There is nobody in this newsgroup using that alias.

13> Tsk. Tsk.

How ironic.
 
A

Arne Vajhøj

Looks like you hit the nail (or the troll) on the head Lew.

No reply at all to your message for 12 hours. And then a poorly-forged
message under my name, followed shortly by one under Paul's new pseudonym?

And it was copied to the OS/2 group, which is something also
seen before.

Arne
 
A

Arne Vajhoj

On Fri, 21 Dec 2012 07:30:33 -0800, Peter Duniho wrote:

1> Newsgroups: comp.lang.java.programmer

1> Looks like you hit the nail (or the troll) on the head Lew.

What does your classic unsubstantiated and erroneous claim have to do
with Java, Duniho?

1> No reply at all to your message for 12 hours.

What does your classic pontification have to do with Java, Duniho?

1> And then a poorly-forged message under my name,

What does your classic erroneous presupposition have to do with Java,
Duniho?

1> followed shortly by> one under Paul's new pseudonym?

Who is "Paul", Duniho? There is nobody in this newsgroup using that alias.

1> He's getting better at his trolling, I'll grant him that.

What does your classic erroneous presupposition have to do with Java,
Duniho?

1> I guess we should've seen it coming.

What does your classic erroneous presupposition have to do with Java,
Duniho?
 
L

Leŵ

On Fri, 21 Dec 2012 17:09:50 +0000, lipska the kat wrote:

1> Newsgroups: comp.lang.java.programmer

1> Yea, er what's Pauls new pseudonym ... is it Lew, or is it you, or
1> who ?

Who is "Paul", lipska? There is nobody in this newsgroup using that alias.

1> Yea, so, see ,,, who are we talking about, and who is this Paul geezer.

How ironic.

1> I don't need to nymshift you twat, I am Lipska the Kat

What does your foul language to do with Java, lipska?

1> Hey that rhymes ...

What does rhyming have to do with Java, lipska?

What does your alias have to do with Java, lipska?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top