Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #19682
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Robert Klemme <shortcutter@googlemail.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Enumset.contains |
| Date | Sat, 10 Nov 2012 00:30:28 +0100 |
| Lines | 35 |
| Message-ID | <ag5i0kF13jmU1@mid.individual.net> (permalink) |
| References | <6btq9811qn454a7s9u4dka81qn6k6e2n56@4ax.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | individual.net N9OY2NkOjNO/jHD3fj+y7g9MrV05FH1BF2VeNVRUx8NTUWqMRiQj+T/BwXSQ+mbtQ= |
| Cancel-Lock | sha1:YcXD27IpLEnLKlqBNvpd4pZ2WIQ= |
| User-Agent | Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 |
| In-Reply-To | <6btq9811qn454a7s9u4dka81qn6k6e2n56@4ax.com> |
| Xref | csiph.com comp.lang.java.programmer:19682 |
Show key headers only | View raw
On 11/09/2012 10:40 PM, Roedy Green wrote: > You might think No. > EnumSet.contains( subset ) would mean containsAnyOf or containsAllOf > but it is meaningless. > > There is an EnumSet.containsAll but no EnumSet.containsAnyOf > > It seems odd Set and EnumSet don't directly support the usual things > mathematicians do with sets, > union > intersection retainAll() > isSubsetOf containsAll() > isSuperSetOf containsAll() > The operations would be so fast internally if Oracle used the binary > logic ops to handle bit strings, rather than flat-footed processing an > element at a time. > > What think you? You can use clone() and retainAll() and check return type, or use addAll() and check whether size < oldSize + other.size(), or write a loop in a few lines... Cheers robert
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Enumset.contains Roedy Green <see_website@mindprod.com.invalid> - 2012-11-09 13:40 -0800
Re: Enumset.contains Lew <lewbloch@gmail.com> - 2012-11-09 15:07 -0800
Re: Enumset.contains Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-11-09 23:50 +0000
Re: Enumset.contains Robert Klemme <shortcutter@googlemail.com> - 2012-11-10 00:30 +0100
Re: Enumset.contains Roedy Green <see_website@mindprod.com.invalid> - 2012-11-10 16:56 -0800
Re: Enumset.contains markspace <-@.> - 2012-11-10 17:10 -0800
Re: Enumset.contains Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-11-10 20:38 -0600
csiph-web