You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Stephen Colebourne <sc...@btopenworld.com> on 2006/07/13 15:56:29 UTC
[collections] Re: Why doesn't Bag have a get() method?
Get what? What method signature are you expecting? What is your use case?
Stephen
----- Original Message ----
From: Timo Nentwig <tn...@verisign.com>
To: Jakarta Commons Users List <co...@jakarta.apache.org>
Sent: Thursday, 13 July, 2006 2:39:59 PM
Subject: Why doesn't Bag have a get() method?
Hi!
Well, see subject: why doesn't Bag have a get() method? Doesn't make sense, does it?
Timo
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [collections] Re: Why doesn't Bag have a get() method?
Posted by Stephen Colebourne <sc...@btopenworld.com>.
Nentwig, Timo wrote:
> Stephen Colebourne wrote:
>
>> Get what? What method signature are you expecting? What is your use case?
>
> Well, get what I did add(). Get that what contains() is checking for.
> Get what getCount() is counting.
I believe that you want the method:
public Object get(Object);
that would return the object within the Bag that is equal to the object
you pass in.
This has been discussed before as a deficiency in the Java Collections
Framework wrt the Set interface. At present, the workaround in Java is
to use a Map where the key and value are the same object.
As to your question, why doesn't Bag have such a method, the answer is
because the original coders didn't see the need for it. And since its an
interface, there is no way for us to change it now. It is also very
difficult to implement as the Java Collections Framework doesn't provide
such a method.
Stephen
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [collections] Re: Why doesn't Bag have a get() method?
Posted by Paul J DeCoursey <pa...@decoursey.net>.
Let's stay sane here...
Basicly it comes down to this Timo, you must use other classes to access
individual items in the Bag. You can access via the toArray or
uniqueSet. If it's a MapBag, then you'd use getMap, and from there you
can use get(). In a sense Bag indirectly does have a get method.
Paul
James Carman wrote:
> Why don't you write Sun and ask them to add a get() method to the
> java.util.Set interface too?
>
> -----Original Message-----
> From: Nentwig, Timo [mailto:tnentwig@verisign.com]
> Sent: Thursday, July 13, 2006 4:10 PM
> To: Jakarta Commons Users List
> Subject: Re: [collections] Re: Why doesn't Bag have a get() method?
>
> Stephen Colebourne wrote:
>
>> Get what? What method signature are you expecting? What is your use case?
>>
>
> Well, get what I did add(). Get that what contains() is checking for. Get
> what getCount() is counting.
>
>
>> ----- Original Message ----
>> From: Timo Nentwig <tn...@verisign.com>
>> To: Jakarta Commons Users List <co...@jakarta.apache.org>
>> Sent: Thursday, 13 July, 2006 2:39:59 PM
>> Subject: Why doesn't Bag have a get() method?
>>
>> Hi!
>>
>> Well, see subject: why doesn't Bag have a get() method? Doesn't make
>>
> sense, does it?
>
>> Timo
>>
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
RE: [collections] Re: Why doesn't Bag have a get() method?
Posted by James Carman <ja...@carmanconsulting.com>.
Why don't you write Sun and ask them to add a get() method to the
java.util.Set interface too?
-----Original Message-----
From: Nentwig, Timo [mailto:tnentwig@verisign.com]
Sent: Thursday, July 13, 2006 4:10 PM
To: Jakarta Commons Users List
Subject: Re: [collections] Re: Why doesn't Bag have a get() method?
Stephen Colebourne wrote:
> Get what? What method signature are you expecting? What is your use case?
Well, get what I did add(). Get that what contains() is checking for. Get
what getCount() is counting.
> ----- Original Message ----
> From: Timo Nentwig <tn...@verisign.com>
> To: Jakarta Commons Users List <co...@jakarta.apache.org>
> Sent: Thursday, 13 July, 2006 2:39:59 PM
> Subject: Why doesn't Bag have a get() method?
>
> Hi!
>
> Well, see subject: why doesn't Bag have a get() method? Doesn't make
sense, does it?
>
> Timo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
[Commons-EMAIL] bulk email
Posted by Vimarsh Vasavada <vi...@c-sam.co.in>.
Hello all!
We have application requiring to send bulk emails to large number of
users-around 1,00,000!
We have 2 basic needs:
1. Sending alert email to ALL users.
2. Sending customized email to individual users.
For both these kind of scenarios,does commons-email provides any API?
Are there any patterns for such cases? I am thinking to use
multithreading?!?!
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.10/387 - Release Date: 7/12/2006
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [collections] Re: Why doesn't Bag have a get() method?
Posted by Matt Benson <gu...@yahoo.com>.
<snicker>
--- "Nentwig, Timo" <tn...@verisign.com> wrote:
> Stephen Colebourne wrote:
> > Get what? What method signature are you expecting?
> What is your use case?
>
> Well, get what I did add(). Get that what contains()
> is checking for. Get what getCount() is counting.
>
> > ----- Original Message ----
> > From: Timo Nentwig <tn...@verisign.com>
> > To: Jakarta Commons Users List
> <co...@jakarta.apache.org>
> > Sent: Thursday, 13 July, 2006 2:39:59 PM
> > Subject: Why doesn't Bag have a get() method?
> >
> > Hi!
> >
> > Well, see subject: why doesn't Bag have a get()
> method? Doesn't make sense, does it?
> >
> > Timo
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> >
> >
> >
> >
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> >
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [collections] Re: Why doesn't Bag have a get() method?
Posted by "Nentwig, Timo" <tn...@verisign.com>.
Stephen Colebourne wrote:
> Get what? What method signature are you expecting? What is your use case?
Well, get what I did add(). Get that what contains() is checking for. Get what getCount() is counting.
> ----- Original Message ----
> From: Timo Nentwig <tn...@verisign.com>
> To: Jakarta Commons Users List <co...@jakarta.apache.org>
> Sent: Thursday, 13 July, 2006 2:39:59 PM
> Subject: Why doesn't Bag have a get() method?
>
> Hi!
>
> Well, see subject: why doesn't Bag have a get() method? Doesn't make sense, does it?
>
> Timo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org