In association with heise online

04 January 2010, 11:48

New Java Collections from Google

  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit

Java's existing collection data types, such as Set, List and Map are now complemented by Google's release of version 1.0 of its Collections Library. The library adds, among other things, implementations of Multimap, which allows multiple values to be associated with a single key, and Multiset, a set which allows duplicate items and is often referred to as a bag.

Another addition is BiMap which can create maps which require unique values and unique keys; this then allows for bidirectional access to the map through an inverse view that presents the values as keys and vice versa. A MapMaker class has been included to simplify the creation of ConcurrentHashMaps. The release also includes a "Comparator on Steroids", Ordering, which adds methods to support many common operations needed when sorting collections and utility classes such as Iterators and Iterables which can make use of the Ordering implementation.

The Collections Library is available under the Apache License 2.0 and can also be downloaded as a zip archive (direct dowload). The Collections Library is to become part of Google's Guava-libraries project, which aims to provide a core set of Java libraries that Google already uses internally.


Print Version | Send by email | Permalink:

  • July's Community Calendar

The H Open

The H Security

The H Developer

The H Internet Toolkit