On Mon, 23 Apr 2001, Waldhoff, Rodney wrote:

> Over the weekend, I checked in several files that Peter had sent to me some
> time ago to include in the Commons-Collections package.
> 
> One of the more interesting ones is ListUtils, which provides various
> set-theoretic operations (union, intersection, etc.) for java.util.List
> implementations.  A couple of things strike me about this:
> 
> 1. It seems like it would be straightforward to recast this as operations on
> Collection implementations, rather than just List implementations.
> 

Will there be efficiency differences large enough to warrant two different
implementations -- or maybe three if java.util.Set operators should be
handled separately)?

> 2. The "sum" method, which computes union(minus(A,B),minus(B,A)) for two
> lists A and B, is an operation I've usually seen referred to as the
> "symmetric difference" or "[exclusive] disjunction" of two sets.
> 
> If another project (Avalon, I assume) is to be a client of collections
> ListUtil, I don't want to go breaking the interface willy-nilly, but it
> makes sense to me to move toward supporting generalized Collections, and to
> rename sum (to disjunction?).  Anyone care to comment?
> 

I will leave it to the mathmeticians to tell us what the correct name
is.  However, if we're going to switch, now is definitely the time.

NOTE:  If you do the switch, I would strongly urge you to leave the sum()
function in the API, but deprecate it for some reasonable period of time.

>  - R
> 

Craig


Reply via email to