RSS feed [root] /weblog /development /google




login:

password:

title search:




 


Wed Feb 13 05:31:57 GMT 2013

guava



Using collection transformer - http://codemunchies.com[..]ordering-with-google-collections-part-3/

Optional - http://kerflyn.wordpress.com[..]12/05/from-optional-to-monad-with-guava/

Pre-condition - http://marxsoftware.blogspot.com[..]m/2011/10/guava-preconditions-class.html

Some of the most noteworthy collections are:

1) BiMap - A Map that guarantees unique values, and supports an inverse view
2) 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.
3) Multimap - Similar to Map, but may contain duplicate keys. Has subtypes SetMultimap and ListMultimap providing more specific behavior. There is also index() function to convert a list to multimap - http://google-collections.googlecode.com[..]Multimaps.html#index(java.lang.Iterable, com.google.common.base.Function)
4) ClassToInstanceMap - A specialized Map whose keys are class literals and whose values are instances of those types.

Google has also included a number of utility classes that also work with these new collections. Some of these include:

1) Comparators - Natural order, compound, null-friendly, ad-hoc . . . http://danhaywood.com[..]/02/02/using-google-guavas-ordering-api/
2) Iterators and Iterables - Element-based equality, cycle, concat, partition, filter with predicate, transform with function . . .
3) Lists, Sets and Maps - A plethora of convenient factory methods and much more.
4) PrimitiveArrays - "boxing"/"unboxing" of primitive arrays
5) Object.equals and hashCode - Provide built-in null-handling.

- http://www.infoq.com/news/2007/10/collections-api http://users.mafr.de/~matthias/articles/google-collections.html

Example of filtering - http://marxsoftware.blogspot.com.au[..]/10/filtering-and-transforming-java.html

Helper for creating factory class - http://techneerajnandwana.blogspot.hk[..]hk/2012/02/guava-classtoinstancemap.html


(google search) (amazon search)
second
download zip of files only