»
S
I
D
E
B
A
R
«
Google-Collections 1.0 release candidate!
Apr 8th, 2009 by Rikard Qvarforth

Nu är den äntligen här som Rc Ettan för google collections :)

Här är release notes för 1.0 RC

Laddas ned på denna länk google-collect-1.0-rc1.zip



  • com.google.common.annotations package with new annotations for marking types as gwt compatible (GwtCompatible, GwtIncompatible), and marking a type or member as being visible only for testing (VisibleForTesting)
  • Joiner, which joins pieces of text together, replacing the old static methods on the Join class.
  • Predicate.instanceOf(Class) returns a Predicate that evaluates to true if the object being tested is an instance of the given class.
  • MutableClassToInstanceMap and ImmutableClassToInstanceMap, which map a class to an instance of that class.
  • ImmutableSetMultimap is a SetMultimap with reliable user specified key and value iteration order.
  • Maps.difference(…) computes the difference between two maps, returning the result as a MapDifference.
  • Collections2.transform(…) is the Collection-based equivalent of Iterables.transform(..), and returns the Collection that results from applying a Function to each element of a given Collection.
  • New ImmutableMultimap.of(..) static methods were added to quickly create immutable maps of specified values.
  • ImmutableMultimap.Builder has a new putAll(…) method to store another multimap’s entries in the built multimap.
  • Multisets.immutableEntry(E, int) returns a new immutable Multiset.Entry with the specified element and count.
  • Multiset has new setCount() methods that can be used to add or remove the necessary number of occurences of an element such that the element attains the desired count.


  • http://code.google.com/p/jsr-305/)
  • Deprecated Functions.TO_STRING removed in favor of Functions.toStringFunction().
  • Functions.toHashCode(). This isn’t a commonly used function, and can be implemented by hand if needed.
  • Preconditions.checkContentsNotNull(…)
  • Predicates.isSameAs(Object). This wasn’t commonly used, and can be easily implemented by hand.
  • The following methods were removed from Iterables: containsNull(Iterable), emptyIterable(), limit(Iterable, int), rotate(List, int), skip(Iterable, int).
  • The following methods were removed from Iterators: containsNull(Iterable), emptyListIterator(), limit(Iterator, int), skip(Iterator, int).
  • The Multimaps.index(..) method that takes a multimap as the third argument has been removed.
  • The Sets.SetView constructor is no longer public (this was an oversight).
  • Multiset.removeAllOccurrences(Object). You can replace usages of this with elementSet().remove(Object).
  • AbstractMapEntry. Most usages of this can be replaced with java.util.AbstractMap.SimpleEntry/SimpleImmutableEntry provided their keys and values are directly stored in the Entry instance.
  • Constraints, Constraint and MapConstraints.
  • CustomConcurrentHashMap.
  • Serialization.


  • ConcurrentHashMultiset.
  • Predicates.isEqualTo(T) renamed to Predicates.equalTo(T)
  • AbstractIterator now extends UnmodifiableIterator.
  • The constructors on ArrayListMultimap, HashBiMap, HashMultimap, HashMultiset, ImmutableBiMap, LinkedHashMultimap, LinkedHashMultiset, LinkedListMultimap, TreeMultimap, and TreeMultiset were removed in favor of new static create() methods which provide type inference. The various static creation methods on Multimaps were removed in favor of create() methods on each Multimap class.
  • Iterators.newArray(..) and Iterables.newArray(..) were renamed to toArray(..).
  • The instance methods in Ordering are all now final.
Download
»  Substance: WordPress   »  Style: Ahren Ahimsa
© copyright@alltomjava