xueyin87 / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Please provide Sets.symmetricDifference() #300

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently Sets.difference(a, b) and Sets.difference(b, a) are not the same.
Please provide a Sets.symmetricDifference(a, b) method which returns the set 
of elements that are in either set a or set b but not both according to the 
definition here: 
http://www.itl.nist.gov/div897/sqg/dads/HTML/symmetricSetDiff.html

Please also update the documentation for Sets.difference() to indicate that it 
is 
not symmetric (despite the obvious assumption from set theory) and that the 
user should use Sets.symmetricDifference() if that's what they want.

Original issue reported on code.google.com by adewale on 18 Nov 2009 at 10:23

GoogleCodeExporter commented 9 years ago
I have added a patch that provides the required functionality and a test for it.

Original comment by adewale on 3 Dec 2009 at 4:13

Attachments:

GoogleCodeExporter commented 9 years ago
The patch is the wrong implementation as explained off-line, but the request is 
valid.

Original comment by kevinb@google.com on 8 Dec 2009 at 5:29

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 9 Apr 2010 at 5:42

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:16

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:10