This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

enum and collection

 
Ranch Hand
Posts: 937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know there is common collection package. Can you tell me the circumstances
where i can use these.
 
Ranch Hand
Posts: 8934
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Features are listed here
http://jakarta.apache.org/commons/collections/
 
sunitha reghu
Ranch Hand
Posts: 937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know that . where in real life i can use that instead of java collection framwork.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Commons Collections library is such low-level stuff that it's difficult to come up with sensible real-world examples beyond those mentioned on the project's homepage.
Here's a question, though, that might help clarify the usefulness of Commons Collections:
How many times have you written a piece of code that iterates through a java.util.Map?
You've probably written something like

Now, the Commons Collection library includes (among many others) a MapIterator interface that let's you do the same thing in a slightly less verbose manner:

The difference is so small that I have never actually used the Commons Collection library but looking at the vast number of specialized collection classes available, I certainly acknowledge there are occasions where they might come very handy.
 
Author
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest that you download the source code for the book 'Pro Jakarta Commons' and try out the Collections and Primitives examples. We have tried to take up examples that would help adoption of the Collections component on real world projects. The Primitives component provides collections for primitives like int, float, long...
Apress Author Page
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Harshad Oak:
The Primitives component provides collections for primitives like int, float, long...


Do you have an idea why there are no Set implementations? I recently would have liked an IntSet...
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ilja Preuss:
Do you have an idea why there are no Set implementations? I recently would have liked an IntSet...

Oh, I bet you already committed one to the Commons CVS
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Lasse Koskela:
Oh, I bet you already committed one to the Commons CVS


Mhh, would have been an option, I guess - though I don't know how hard it is to get a patch accepted by the team. And as it wasn't my very first contact with jakarta commons, it would have been some work to become acquainted with the project...
 
This. Exactly this. This is what my therapist has been talking about. And now with a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!