Need clarification on Object.equals.

A

Arne Vajhøj

On 19/12/12 14:09, Arne Vajhøj wrote:
On 12/19/2012 9:07 AM, Arne Vajhøj wrote:
On 12/19/2012 6:22 AM, Patricia Shanahan wrote:
On 12/19/2012 2:20 AM, lipska the kat wrote:
...

[snip]


My point is that while newbies do have a "allowed to post
stupid questions" card, then they do not have a "allowed
to insult others without being criticized for it" card.
Your arrogance is almost beyond belief. Listen to yourself
You really do think that you are in some way qualified to pass judgment
on what is a stupid question and what isn't.

Congratulations you completely missed the point.

No I didn't and I quote

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

Who 'allows' them to post stupid questions.
You ?

Who decides who is a newbie
You ?

Who decides it is a stupid question
You ?

And before you use the 'community' card

Who made you the spokesperson
You ?

Well ?

Yes - you missed the point, but let me try to explain again.

My point is that I am not objecting to questions whether
I consider them stupid or not (or whether I consider the
person a newbie or not) - I am objecting to the
person asking the question insulting those that try to help.

Arne
 
J

Joshua Cranmer

Yes I understand that. In fact, as I pointed out in a subsequent
post, none of my code defines equals, Node was however extending
AbstractSet which does redefine it. Really All I was looking for was
a general direction I might look and not to burden anyone with large
blocks of code. Node is 212 lines, Gate is 67, Monitor another 85,
none of which even once mentions the word "equals"

Your original post gave no indication that Node inherited from
AbstractSet. Actually, you gave no indication of any inheritance
structure, etc. The only way we could know what the problem was would be
to either read your mind or to give a general, vague answer. Providing
sufficient information to mention this would have precluded the whole
debate.

That's why there's so much emphasis on the SSCCEs (short,
self-contained, compilable code examples) in this newsgroup: if you can
minimize the problem down to a self-contained solution that is small
enough to include in a post, it gives all the information we need. And,
often times, just trying to minimize it may lead you to the answer
without needing to ask the question in the first place.
 
A

Arne Vajhøj

Your original post gave no indication that Node inherited from
AbstractSet. Actually, you gave no indication of any inheritance
structure, etc. The only way we could know what the problem was would be
to either read your mind or to give a general, vague answer. Providing
sufficient information to mention this would have precluded the whole
debate.

That's why there's so much emphasis on the SSCCEs (short,
self-contained, compilable code examples) in this newsgroup: if you can
minimize the problem down to a self-contained solution that is small
enough to include in a post, it gives all the information we need. And,
often times, just trying to minimize it may lead you to the answer
without needing to ask the question in the first place.

An SSCCE would have been great.

But even something as simple as:

public abstract class Node extends AbstractSet {
// no equals method
}

public class Gate extends Node {
// no equals method
}

public class Monitor extends Node {
// no equals method
}

Node a = new Gate();
Monitor b = new Monitor();
System.out.println(a.equals(b)); // --> prints 'true'

would have helped.

But I don't know if it is so relevant. That distillation almost require
knowing what the problem is.

Arne
 
A

Arne Vajhøj

On 19/12/12 14:42, Arne Vajhøj wrote:
On 12/19/2012 9:36 AM, lipska the kat wrote:
On 19/12/12 14:09, Arne Vajhøj wrote:
On 12/19/2012 9:07 AM, Arne Vajhøj wrote:
On 12/19/2012 6:22 AM, Patricia Shanahan wrote:
On 12/19/2012 2:20 AM, lipska the kat wrote:
...

[snip]


My point is that while newbies do have a "allowed to post
stupid questions" card, then they do not have a "allowed
to insult others without being criticized for it" card.

Your arrogance is almost beyond belief. Listen to yourself
You really do think that you are in some way qualified to pass
judgment
on what is a stupid question and what isn't.

Congratulations you completely missed the point.

No I didn't and I quote

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

Who 'allows' them to post stupid questions.
You ?

Who decides who is a newbie
You ?

Who decides it is a stupid question
You ?

And before you use the 'community' card

Who made you the spokesperson
You ?

Well ?

Yes - you missed the point, but let me try to explain again.

My point is that I am not objecting to questions whether
I consider them stupid or not (or whether I consider the
person a newbie or not) - I am objecting to the
person asking the question insulting those that try to help.

Well you still don't get it do you
I don't defend insulting behavior

Then why do you complain about me pointing out insulting behavior?

Arne
 
L

Lars Enderin

2012-12-19 16:47, lipska the kat skrev:
This is Usenet, if you don't like it, go somewhere else. I do like it so
I'm staying and I will continue however futile it may be to stand up
against the ludicrous pomposity and arrogance I see here. Get used to it.

Did I imply that I don't like Usenet? You seem to misunderstand a lot.
And I don't see much pomposity and arrogance here. I've been on Usenet
for 25 years or more.
 
L

Lars Enderin

2012-12-19 16:40, lipska the kat skrev:
On 19/12/12 14:42, Arne Vajhøj wrote:
On 12/19/2012 9:36 AM, lipska the kat wrote:
On 19/12/12 14:09, Arne Vajhøj wrote:
On 12/19/2012 9:07 AM, Arne Vajhøj wrote:
On 12/19/2012 6:22 AM, Patricia Shanahan wrote:
On 12/19/2012 2:20 AM, lipska the kat wrote:
...

[snip]


My point is that while newbies do have a "allowed to post
stupid questions" card, then they do not have a "allowed
to insult others without being criticized for it" card.

Your arrogance is almost beyond belief. Listen to yourself
You really do think that you are in some way qualified to pass
judgment
on what is a stupid question and what isn't.

Congratulations you completely missed the point.

No I didn't and I quote

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

Who 'allows' them to post stupid questions.
You ?

Who decides who is a newbie
You ?

Who decides it is a stupid question
You ?

And before you use the 'community' card

Who made you the spokesperson
You ?

Well ?

Yes - you missed the point, but let me try to explain again.

My point is that I am not objecting to questions whether
I consider them stupid or not (or whether I consider the
person a newbie or not) - I am objecting to the
person asking the question insulting those that try to help.

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.

You said

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

Who 'allows' them to post stupid questions.

Do you understand the question

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

You are takings things too literally. Makes me think of Asperger's
syndrome and related.
 
F

FredK

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.
 
A

Arne Vajhøj

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
 
L

Lars Enderin

2012-12-19 17:22, Arne Vajhøj skrev:
It is rather unusual to have objects of different classes considered
equals.

Your example is different.

Both Gate and Monitor were extensions of AbstractSet, and empty, which
eventually led to Set#containsAll, and thus equals, returning true.
 
A

Arne Vajhøj

2012-12-19 17:22, Arne Vajhøj skrev:

Both Gate and Monitor were extensions of AbstractSet, and empty, which
eventually led to Set#containsAll, and thus equals, returning true.

Yes. We know that now. And the problem was solved by not
extending that.

But if the class should continue to extend from
that it should probably have overridden equals again
with an implementation that did use instanceof to test
for type (it could have called super.equals after that
if appropriate).

Arne
 
J

Joshua Cranmer

On 19/12/12 14:09, Arne Vajhøj wrote:
On 12/19/2012 9:07 AM, Arne Vajhøj wrote:
On 12/19/2012 6:22 AM, Patricia Shanahan wrote:
On 12/19/2012 2:20 AM, lipska the kat wrote:
...

[snip]


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

Your arrogance is almost beyond belief. Listen to yourself
You really do think that you are in some way qualified to pass judgment
on what is a stupid question and what isn't.

I would suggest that you finish reading entire posts before starting
yelling matches, for if you had finished the sentence (assuming basic
fluency in reading comprehension), you would have learned that Arne was
opining that the criterion for what should be considered socially
acceptable by this newsgroup isn't the quality of the question but
rather by whether or not it is insulting. Also note that there was in no
way any attempt to delineate specifically what class of questions
corresponds to "stupid questions," which is apt because the entire point
of the post was to postulate the nonimportance of such a class.

Well for someone who can spout such a long winded discourse about
nothing in particular I'm surprised you don't see the obvious.

When you have four people who have all pointed out that you probably
missed the point, the evidence is in favor that you miscomprehended the
intended point of the state.
Lets take the sentence

"allowed to post stupid questions"

Who or what exactly 'allows' someone to post a question. I suggest it is
the nntp protocol over the users internet connection, it certainly isn't
you or one of you little group of self appointed administrators.

If you read what I wrote (I suspect you didn't, at least not closely),
you will notice that I referred to it as "what [is] considered socially
acceptable by this newsgroup"; that is how I read "allowed to post."
What makes you or anyone else qualified to determine the validity of any
question anywhere on Usenet ... your own grossly inflated ego perhaps.

And the entire point of Arne's post in the first place was that whether
or not a question is socially accepted in this newsgroup is
*independent* of its valuation as a "stupid question" or not. He never
portrayed himself as qualified to determine the metric of how stupid or
not stupid a question is.
You are missing the point. It is not this particular instance of
arrogance I particularly object to although there have been some
spectacular instances of arrogance here today, but the general
preponderance of puffed up self appointed quasi academic popinjays
that inhabit usenet in general and this group in particular and are
strangling what should be a forum for the free and frank exchange of views.

Oh, so you dislike everyone who acts like you. I get it. :)
 
A

Arne Vajhøj

And here's a thing. Why do Arne and his pals feel the need to chastise
someone for being 'insulting' to a particular responder. Surely that
responder will speak up if he feels offended.

Why do you or Arne or anyone else for that matter feel the need to
interfere in this way. Do you feel you have a right because you have
'been on Usenet for 25 years' or so. Why don't you let people speak for
themselves.
Anyway I think I've got to the bottom of what it is that's bugging me.
It's this apparent right you (collectively) feel you have to chastise
someone for behaviour you feel is inappropriate for this group.

Why can't you just mind your own business.

If that is your opinion, then why did *you* comment??

Arne
 
L

Lars Enderin

2012-12-19 17:51, lipska the kat skrev:
Well you wouldn't I guess

I have a question

Why do you (collectively) feel the need to chastise someone for
behaviour that you decide is inappropriate for this group when that
behaviour is not directed at you. I expand on this in a reply to Arne
elsewhere.

Why don't you like it when somebody stands up for somebody else? It's
not abnormal behaviour. And in this case Arne may have felt that the
OP's reply was (also) directed at him. But I am not allowed to answer
for Arne, right?
 
L

Lars Enderin

2012-12-19 18:32, lipska the kat skrev:
On 19/12/12 14:58, Joshua Cranmer wrote:
On 12/19/2012 8:36 AM, lipska the kat wrote:
On 19/12/12 14:09, Arne Vajhøj wrote:
On 12/19/2012 9:07 AM, Arne Vajhøj wrote:
On 12/19/2012 6:22 AM, Patricia Shanahan wrote:
[snip]


Oh, so you dislike everyone who acts like you. I get it. :)

I seriously doubt if you get anything other than your own inflated sense
of self importance. See elsewhere for a discourse on the frankly rather
distasteful behaviour exhibited by you and your little band of brothers
towards me and others in this group.

I don't see how you arrive at those terms of characterization from what
has been written here. How do you determine that Joshua has an inflated
sense of self-importance? What makes you use words like "distasteful"? I
submit that your views may be more than a little skewed.
 
J

Joshua Cranmer

I seriously doubt if you get anything other than your own inflated sense
of self importance. See elsewhere for a discourse on the frankly rather
distasteful behaviour exhibited by you and your little band of brothers
towards me and others in this group.

That statement was not meant to be taken seriously. To match your
exacting statements, I shall henceforth extricate any attempt at humor
from all future postings.
 
A

Arne Vajhøj

Oh it was humor was it... I'm sorry, I seem to have undergone a bit of a
humor bypass recently, perhaps you have noticed.

Once you have some spare time I suggest you start learning about
those small symbols sometimes used on the internet.

Like :)

Arne
 
A

Arne Vajhøj

The behaviour of you and you pals is unacceptable to me.
Pals?

If I see this behaviour again I will take you to task again.

You will just make a fool out of yourself again.

Arne
 
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?

[snip]
jeez, I haven't got this worked up in a while.

So lighten up a bit.

Sincerely,

Gene Wirchenko
 

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,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top