You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Peter Billen <pe...@clueless.be> on 2005/02/09 20:43:34 UTC

count/delete/contains elements of collection using iterator,

Hi,

I was wondering if there are functions to count in a collection using the
iterator, checking if an element is contained in a collection using the
iterator, deleting etc. I know these are simple while-loops, but I was
wondering if they were already avaiable in the library. I couldn't find
anything in the API docs.

thanks,

--
Peter






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


Re: count/delete/contains elements of collection using iterator,

Posted by Peter Billen <pe...@clueless.be>.
Mario Winterer wrote:

> Have you already looked at the jakarta.commons.collections-API?

Yes ofcourse, I browsed through IteratorUtils and the .iterators-package, but I
couldn't find anything relevant. So I believe it isn't there, but I asked it to
be sure anyway.

thanks,

--
Peter


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


Re: count/delete/contains elements of collection using iterator,

Posted by Mario Winterer <ma...@eduhi.at>.
Have you already looked at the jakarta.commons.collections-API?

Peter Billen wrote:

>Hi,
>
>I was wondering if there are functions to count in a collection using the
>iterator, checking if an element is contained in a collection using the
>iterator, deleting etc. I know these are simple while-loops, but I was
>wondering if they were already avaiable in the library. I couldn't find
>anything in the API docs.
>
>thanks,
>
>--
>Peter
>
>
>
>
>
>
>---------------------------------------------------------------------
>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: count/delete/contains elements of collection using iterator,

Posted by Mario Winterer <ma...@eduhi.at>.
If you are missing something in the JDK's collection API or you're 
wondering why the collection API is like it is, maybe the design-FAQs 
can help you: 
http://java.sun.com/j2se/1.5.0/docs/guide/collections/designfaq.html

  Tex

Peter Billen wrote:

>Hi,
>
>I was wondering if there are functions to count in a collection using the
>iterator, checking if an element is contained in a collection using the
>iterator, deleting etc. I know these are simple while-loops, but I was
>wondering if they were already avaiable in the library. I couldn't find
>anything in the API docs.
>
>thanks,
>
>--
>Peter
>
>
>
>
>
>
>---------------------------------------------------------------------
>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: count/delete/contains elements of collection using iterator,

Posted by Peter Billen <pe...@clueless.be>.
Stephen Colebourne wrote:

> [collections] generally deals with iterators by asking you to convert them
> to a collection, for which we provide a method. Have a scan of
> CollectionUtils to see if that helps.

CollectionUtils.size() did the trick

thanks,

--
Peter


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


Re: count/delete/contains elements of collection using iterator,

Posted by Stephen Colebourne <sc...@btopenworld.com>.
[collections] generally deals with iterators by asking you to convert them 
to a collection, for which we provide a method. Have a scan of 
CollectionUtils to see if that helps.

Stephen

----- Original Message ----- 
From: "Peter Billen" <pe...@clueless.be>
> I was wondering if there are functions to count in a collection using the
> iterator, checking if an element is contained in a collection using the
> iterator, deleting etc. I know these are simple while-loops, but I was
> wondering if they were already avaiable in the library. I couldn't find
> anything in the API docs.
>
> thanks,
>
> --
> Peter
>
>
>
>
>
>
> ---------------------------------------------------------------------
> 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