You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by __matthewHawthorne <mh...@alumni.pitt.edu> on 2003/08/29 20:06:39 UTC

[collections] dual list/set implementation?

I recently had to write a small class which followed the contract of 
java.util.List and java.util.Set... it maintained order and did not 
allow duplicates. 

I couldn't find such a class already in collections, did I miss it?  I 
thought I remembered a discussion about this a while back.

If not, is there interest in adding this class?



Re: [collections] dual list/set implementation?

Posted by Stephen Colebourne <sc...@btopenworld.com>.
From: "Henri Yandell" <ba...@generationjava.com>
> > And is Ordered a better name than Sequenced?
> 
> I think so :)
I'll rename sometime soon unless anyone else objects.

Stephen


Re: [collections] dual list/set implementation?

Posted by Henri Yandell <ba...@generationjava.com>.

On Wed, 3 Sep 2003, Stephen Colebourne wrote:

> The main package contains SequencedHashMap.
> The decorators package contains SequencedSet.
>
> Be nice to have a SequencedMap in the decorators package. Any volunteers?

Will do. Unless someone else gets it in first. Probably a weekend thing
though, Wed/Thurs get busy.

> And is Ordered a better name than Sequenced?

I think so :)

Hen


Re: [collections] dual list/set implementation?

Posted by Stephen Colebourne <sc...@btopenworld.com>.
The main package contains SequencedHashMap.
The decorators package contains SequencedSet.

Be nice to have a SequencedMap in the decorators package. Any volunteers?

And is Ordered a better name than Sequenced?

Stephen

----- Original Message -----
From: "Henri Yandell" <ba...@generationjava.com>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Monday, September 01, 2003 1:04 AM
Subject: Re: [collections] dual list/set implementation?


>
> Might be a good reason to rename SequencedHashMap in Collections to
> LinkedHashMap :)
>
> I'm all for an OrderedSet in Collections. Had thought there was one there,
> it's something I've written for myself in the past.
>
> Hen
>
> On Sat, 30 Aug 2003, Chris Feldhacker wrote:
>
> > Java 1.4 provides java.util.LinkedHashMap, which does what you're
> > describing, only with a Map.
> >
> > Perhaps collections could mimic it...?
> >
> >
> > ----- Original Message -----
> > From: "__matthewHawthorne"
> > To: "Jakarta Commons Developers List"
> > Sent: Friday, August 29, 2003 1:06 PM
> > Subject: [collections] dual list/set implementation?
> >
> >
> > I recently had to write a small class which followed the contract of
> > java.util.List and java.util.Set... it maintained order and did not
> > allow duplicates.
> >
> > I couldn't find such a class already in collections, did I miss it?  I
> > thought I remembered a discussion about this a while back.
> >
> > If not, is there interest in adding this class?
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


Re: [collections] dual list/set implementation?

Posted by Henri Yandell <ba...@generationjava.com>.
Might be a good reason to rename SequencedHashMap in Collections to
LinkedHashMap :)

I'm all for an OrderedSet in Collections. Had thought there was one there,
it's something I've written for myself in the past.

Hen

On Sat, 30 Aug 2003, Chris Feldhacker wrote:

> Java 1.4 provides java.util.LinkedHashMap, which does what you're
> describing, only with a Map.
>
> Perhaps collections could mimic it...?
>
>
> ----- Original Message -----
> From: "__matthewHawthorne"
> To: "Jakarta Commons Developers List"
> Sent: Friday, August 29, 2003 1:06 PM
> Subject: [collections] dual list/set implementation?
>
>
> I recently had to write a small class which followed the contract of
> java.util.List and java.util.Set... it maintained order and did not
> allow duplicates.
>
> I couldn't find such a class already in collections, did I miss it?  I
> thought I remembered a discussion about this a while back.
>
> If not, is there interest in adding this class?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


Re: [collections] dual list/set implementation?

Posted by Chris Feldhacker <fe...@mchsi.com>.
Java 1.4 provides java.util.LinkedHashMap, which does what you're
describing, only with a Map.

Perhaps collections could mimic it...?


----- Original Message ----- 
From: "__matthewHawthorne"
To: "Jakarta Commons Developers List"
Sent: Friday, August 29, 2003 1:06 PM
Subject: [collections] dual list/set implementation?


I recently had to write a small class which followed the contract of
java.util.List and java.util.Set... it maintained order and did not
allow duplicates.

I couldn't find such a class already in collections, did I miss it?  I
thought I remembered a discussion about this a while back.

If not, is there interest in adding this class?



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




Re: [collections] dual list/set implementation?

Posted by Stephen Colebourne <sc...@btopenworld.com>.
The trouble is that it can't actually implement both interfaces properly.
But there might be a case to have it anyway, with suitable warnings.

Stephen

----- Original Message -----
From: "__matthewHawthorne" <mh...@alumni.pitt.edu>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Friday, August 29, 2003 7:06 PM
Subject: [collections] dual list/set implementation?


> I recently had to write a small class which followed the contract of
> java.util.List and java.util.Set... it maintained order and did not
> allow duplicates.
>
> I couldn't find such a class already in collections, did I miss it?  I
> thought I remembered a discussion about this a while back.
>
> If not, is there interest in adding this class?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>