What is the difference between Object2ObjectXXX and Object2ReferenceXXX?

64 views
Skip to first unread message

Richard Browne

unread,
Aug 8, 2017, 10:20:20 PM8/8/17
to fastutil
 Hi

I can discern any difference between classes such as Object2ObjectMap/Object2ReferenceMap. How does an object different from a reference? The javadocs seem the same for these classes, as do the java source files.

Confused.

Sebastiano Vigna

unread,
Aug 9, 2017, 3:43:52 AM8/9/17
to fast...@googlegroups.com
Please read carefully the overview. Reference means equality is by ==.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Richard Browne

unread,
Aug 9, 2017, 9:38:35 PM8/9/17
to fastutil
Thank-you for the reply. I understand the difference between Object2XXXMap vs Reference2XXXMap.

But I'm asking about Object2ObjectMap vs Object2ReferenceMap. When does a map compare its values?

Richard Browne

unread,
Aug 9, 2017, 9:41:53 PM8/9/17
to fastutil
Oh duh. So the difference would be in the behavior of the java.util.Map.containsValue() function. Is that right?

Sebastiano Vigna

unread,
Aug 10, 2017, 4:18:24 AM8/10/17
to fast...@googlegroups.com
More generally, the behavior of the values() collection.


On August 10, 2017 3:41:53 AM GMT+02:00, Richard Browne <ric...@timestone.com.au> wrote:
Oh duh. So the difference would be in the behavior of the java.util.Map.containsValue() function. Is that right?


Reply all
Reply to author
Forward
0 new messages