I'm sorry that I have been largely inactive on guice development and
discussions these past few months -- but at least now I finally get to
tell you what I've been working on! (I do intend to come back.)
If you'll forgive the spam:
I've just posted the first public alpha of what we're calling "the
Google Collections Library." (Continuing our long tradition of
creative product naming.) This is a package chock full of collections
and related utilities that fill in what we most felt was missing in
the JDK. We built it to support our legions of Java developers and
projects internally, but now we're opening it up to the world.
The project page is http://google-collections.googlecode.com, and I'll
lift a quick overview from that page right here:
----- snip -----
The major new types are:
* BiMap. A Map that guarantees unique values, and supports an inverse view.
* Multiset. A Collection that may contain duplicate values like a
List, yet has order-independent equality like a Set. Often used to
represent a histogram.
* Multimap. Similar to Map, but may contain duplicate keys. Has
subtypes SetMultimap and ListMultimap providing more specific
behavior.
There are also more than a dozen collection implementations, mostly of
the interfaces above, but not all. ReferenceMap, for example, is a
ConcurrentMap implementation which easily handles any combination of
strong, soft or weak keys with strong, soft or weak values.
[ReferenceMap is Bob's creation and also happens to be copied into the
Guice sources, but please pretend you didn't know that!]
Static utility classes include:
* Comparators. Natural order, compound, null-friendly, ad-hoc . . .
* Iterators and Iterables. Element-based equality, cycle, concat,
partition, filter with predicate, transform with function . . .
* Lists, Sets and Maps. A plethora of convenient factory methods
and much more.
* PrimitiveArrays: "boxing"/"unboxing" of primitive arrays
And there's more:
* Forwarding collections
* Constrained collections
* Implementation helpers like AbstractIterator
----- snip -----
There's a shortage of concurrent collections beyond ReferenceMap, but
we do have a ConcurrentMultiset that should be ready pretty soon.
I really hope you will find this library useful. You're all very
welcome to check out what we have here so far, and please send us your
feedback!
K
--
Kevin Bourrillion @ Google
google-collections.googlecode.com
google-guice.googlecode.com
--
Gregory Kick
http://kickstyle.net/
>
> This looks like a great set of tools. The one thing that I wanted to
> bring up is that we now have Provider<T> from Guice and Supplier<T>
> from google-collections that do/mean the exact same thing. Does it
> make sense to deprecate Provider in favor of the "more widely scoped"
> Supplier?
Only if google-collections is already guice dependency. As the
methods match having one class implement both is easy and allows for
not having the additional dependency.
-Brian
It could make sense to use it. As the collections faq says, Guice already uses ReferenceMap, and could make good use of all the factory methods. They got my vote. And what's a dependency when you've got Jarjar :-)
Thanks so much for the kind words!
Looks suite dude! I wrote some similar Collection stuff that you guys
might find (I know I do) useful. I have a few extra conveniences method
for building some common Maps and also a Pair object. Also, I have a
graph laying around in Savant, that I plan on moving over to Java.net
Commons at some point, which might be useful for you collections.
Here's some pointers to the JavaDoc for those:
http://inversoft.org/javadoc/java-net-commons/1.3/net/java/util/CollectionTools.html
http://inversoft.org/javadoc/java-net-commons/1.3/net/java/util/package-summary.html
http://inversoft.org/javadoc/savant/2.0/net/java/savant/dep/graph/Graph.html
http://inversoft.org/javadoc/savant/2.0/net/java/savant/dep/graph/package-summary.html
-bp
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "google-guice" group.
> To post to this group, send email to google...@googlegroups.com
> To unsubscribe from this group, send email to google-guice...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/google-guice?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
>
JavaDoc at: http://www.limewire.org/nightly/modules/collection/api/org/limewire/collection/PatriciaTrie.html
Code at: https://www.limewire.org/fisheye/browse/~raw,r=MAIN/limecvs/components/collection/src/main/java/org/limewire/collection/PatriciaTrie.java
It's been contributed to the Jakarta Collections library also, but
folks there seem to be very backed up.
Another somewhat useful tool is 'RandomSequence', which lets you
generate a uniquely random sequence from 0 to N, never repeating the
same number twice.
JavaDoc: http://www.limewire.org/nightly/modules/collection/api/org/limewire/collection/RandomSequence.html
Code:
https://www.limewire.org/fisheye/browse/~raw,r=MAIN/limecvs/components/collection/src/main/java/org/limewire/collection/RandomSequence.java
Anyway, I'm sure there's a better place for posting all this... so
direct me as needed. :)
Sam
Wouldn't it be an extremely good idea to shove those blog posts into the
javadocs?! For several classes, I found the javadocs somewhat lacking in
the "nice, but what to use for?" department, but those blog posts really
cleared everything up. So - obvious solution: cut and paste the blog
posts into the javadocs?
Kind regards,
Endre.
Sam
> >>> The project page is http://google-collections.googlecode.com , and
Sam