commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@gmail.com>
Subject Re: [collections] New interface: MultiSet
Date Thu, 11 Jun 2015 21:18:54 GMT
On Thu, Jun 11, 2015 at 3:37 PM, Thomas Neidhart
<thomas.neidhart@gmail.com> wrote:
> Hi,
>
> I have just committed the first draft of the new interface MultiSet.
>
> What is the idea behind this?
>
> The rationale of this interface (and corresponding implementations) is
> to replace the existing Bag interface, which does violate the Collection
> contract. Actually, I wanted to make the Bag interface compliant to the
> general Collection contract prior to the 4.0 release, but was convinced
> otherwise (which I now consider a big mistake).
>
> Thus, in an attempt to rid commons-collections of such violations, the
> Bag interface shall be deprecated and replaced by a MultiSet, which is
> basically the same, but the interface is cleaned up and a little bit
> enhanced.
>
> Operations that take cardinality into account (as currently the Bag
> does), can be provided as static utility methods in a MultiSetUtils
> class, or optionally, as additional methods in the interface (I am yet
> undecided about that).
>
> It would be nice if some people could review the current interface and
> give feedback. There might still be some typos and the base
> implementation needs to be improved, but it already works as intended.

I feel a bit weird about the name... why should any kind of "Set"
include > 1 of given element? If you're already entertaining the idea
of using externally defined static utility methods, couldn't all the
"Bag"-style functionality be provided as such against e.g. a List?

Matt

>
> Thanks,
>
> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message