@ParametersAreNonnullByDefault
Package com.google.common.collect
This package contains generic collection interfaces and implementations, and other utilities for
working with collections. It is a part of the open-source Guava library.
of
of
of
of
of
of
of
of
Collection Types
BiMap- An extension of
Mapthat guarantees the uniqueness of its values as well as that of its keys. This is sometimes called an "invertible map," since the restriction on values enables it to support an inverse view -- which is another instance ofBiMap. Multiset- An extension of
Collectionthat may contain duplicate values like aList, yet has order-independent equality like aSet. One typical use for a multiset is to represent a histogram. Multimap- A new type, which is similar to
Map, but may contain multiple entries with the same key. Some behaviors ofMultimapare left unspecified and are provided only by the subtypes mentioned below. ListMultimap- An extension of
Multimapwhich permits duplicate entries, supports random access of values for a particular key, and has partially order-dependent equality as defined byListMultimap.equals(Object).ListMultimaptakes its name from the fact that the collection of values associated with a given key fulfills theListcontract. SetMultimap- An extension of
Multimapwhich has order-independent equality and does not allow duplicate entries; that is, while a key may appear twice in aSetMultimap, each must map to a different value.SetMultimaptakes its name from the fact that the collection of values associated with a given key fulfills theSetcontract. SortedSetMultimap- An extension of
SetMultimapfor which the collection values associated with a given key is aSortedSet. Table- A new type, which is similar to
Map, but which indexes its values by an ordered pair of keys, a row key and column key. ClassToInstanceMap- An extension of
Mapthat associates a raw type with an instance of that type.
Collection Implementations
of List
of Set
ImmutableSetImmutableSortedSetContiguousSet(seeRange)
of Map
of BiMap
of Multiset
of Multimap
ImmutableMultimapImmutableListMultimapImmutableSetMultimapArrayListMultimapHashMultimapTreeMultimapLinkedHashMultimapLinkedListMultimap
of Table
of ClassToInstanceMap
Classes of static utility methods
Comparison
Abstract implementations
AbstractIteratorAbstractSequentialIteratorImmutableCollectionUnmodifiableIteratorUnmodifiableListIterator
Ranges
Other
Forwarding collections
ForwardingCollectionForwardingConcurrentMapForwardingIteratorForwardingListForwardingListIteratorForwardingListMultimapForwardingMapForwardingMapEntryForwardingMultimapForwardingMultisetForwardingNavigableMapForwardingNavigableSetForwardingObjectForwardingQueueForwardingSetForwardingSetMultimapForwardingSortedMapForwardingSortedMultisetForwardingSortedSetForwardingSortedSetMultimapForwardingTable
-
Interface Summary Interface Description BiMap<K,V> A bimap (or "bidirectional map") is a map that preserves the uniqueness of its values as well as that of its keys.ClassToInstanceMap<B> A map, each entry of which maps a Java raw type to an instance of that type.CollectSpliterators.FlatMapSpliterator.Factory<InElementT,OutSpliteratorT extends java.util.Spliterator<?>> Factory for constructingCollectSpliterators.FlatMapSpliteratorinstances.FilteredMultimap<K,V> An interface for all filtered multimap types.FilteredSetMultimap<K,V> A supertype for filteredSetMultimapimplementations.Interner<E> Provides similar behavior toString.intern()for any immutable type.LinkedHashMultimap.ValueSetLink<K,V> ListMultimap<K,V> AMultimapthat can hold duplicate key-value pairs and that maintains the insertion ordering of values for a given key.MapDifference<K,V> An object representing the differences between two maps.MapDifference.ValueDifference<V> A difference between the mappings from two maps with the same key.MapMakerInternalMap.InternalEntry<K,V,E extends MapMakerInternalMap.InternalEntry<K,V,E>> An entry in a hash table of aMapMakerInternalMap.Segment.MapMakerInternalMap.InternalEntryHelper<K,V,E extends MapMakerInternalMap.InternalEntry<K,V,E>,S extends MapMakerInternalMap.Segment<K,V,E,S>> A helper object for operating onMapMakerInternalMap.InternalEntryinstances in a type-safe and efficient manner.MapMakerInternalMap.StrongValueEntry<K,V,E extends MapMakerInternalMap.InternalEntry<K,V,E>> Marker interface forMapMakerInternalMap.InternalEntryimplementations for strong values.MapMakerInternalMap.WeakValueEntry<K,V,E extends MapMakerInternalMap.InternalEntry<K,V,E>> Marker interface forMapMakerInternalMap.InternalEntryimplementations for weak values.MapMakerInternalMap.WeakValueReference<K,V,E extends MapMakerInternalMap.InternalEntry<K,V,E>> A weakly referenced value that also has a reference to its containing entry.Maps.EntryTransformer<K,V1,V2> A transformation of the value of a key-value pair, using both key and value as inputs.Multimap<K,V> A collection that maps keys to values, similar toMap, but in which each key may be associated with multiple values.Multiset<E> A collection that supports order-independent equality, likeSet, but may have duplicate elements.Multiset.Entry<E> An unmodifiable element-count pair for a multiset.PeekingIterator<E> An iterator that supports a one-element lookahead while iterating.RangeMap<K extends java.lang.Comparable,V> A mapping from disjoint nonempty ranges to non-null values.RangeSet<C extends java.lang.Comparable> RowSortedTable<R,C,V> Interface that extendsTableand whose rows are sorted.SetMultimap<K,V> AMultimapthat cannot hold duplicate key-value pairs.SortedIterable<T> AnIterablewhose elements are sorted relative to aComparator, typically provided at creation time.SortedMapDifference<K,V> An object representing the differences between two sorted maps.SortedMultiset<E> AMultisetwhich maintains the ordering of its elements, according to either their natural order or an explicitComparator.SortedMultisetBridge<E> Superinterface ofSortedMultisetto introduce a bridge method forelementSet(), to ensure binary compatibility with older Guava versions that specifiedelementSet()to returnSortedSet.SortedSetMultimap<K,V> ASetMultimapwhose set of values for a given key are kept sorted; that is, they comprise aSortedSet.Streams.DoubleFunctionWithIndex<R> An analogue ofDoubleFunctionalso accepting an index.Streams.FunctionWithIndex<T,R> An analogue ofFunctionalso accepting an index.Streams.IntFunctionWithIndex<R> An analogue ofIntFunctionalso accepting an index.Streams.LongFunctionWithIndex<R> An analogue ofLongFunctionalso accepting an index.Table<R,C,V> A collection that associates an ordered pair of keys, called a row key and a column key, with a single value.Table.Cell<R,C,V> Row key / column key / value triplet corresponding to a mapping in a table. -
Class Summary Class Description AbstractBiMap<K,V> A general-purpose bimap implementation using any two backingMapinstances.AbstractBiMap.Inverse<K,V> The inverse of any otherAbstractBiMapsubclass.AbstractIndexedListIterator<E> This class provides a skeletal implementation of theListIteratorinterface across a fixed number of elements that may be retrieved by position.AbstractIterator<T> This class provides a skeletal implementation of theIteratorinterface, to make this interface easier to implement for certain types of data sources.AbstractListMultimap<K,V> Basic implementation of theListMultimapinterface.AbstractMapBasedMultimap<K,V> Basic implementation of theMultimapinterface.AbstractMapBasedMultiset<E> Basic implementation ofMultiset<E>backed by an instance ofMap<E, Count>.AbstractMapEntry<K,V> Implementation of theequals,hashCode, andtoStringmethods ofEntry.AbstractMultimap<K,V> A skeletonMultimapimplementation, not necessarily in terms of aMap.AbstractMultiset<E> This class provides a skeletal implementation of theMultisetinterface.AbstractNavigableMap<K,V> Skeletal implementation ofNavigableMap.AbstractRangeSet<C extends java.lang.Comparable> A skeletal implementation ofRangeSet.AbstractSequentialIterator<T> This class provides a skeletal implementation of theIteratorinterface for sequences whose next element can always be derived from the previous element.AbstractSetMultimap<K,V> Basic implementation of theSetMultimapinterface.AbstractSortedKeySortedSetMultimap<K,V> Basic implementation of aSortedSetMultimapwith a sorted key set.AbstractSortedMultiset<E> This class provides a skeletal implementation of theSortedMultisetinterface.AbstractSortedSetMultimap<K,V> Basic implementation of theSortedSetMultimapinterface.AbstractTable<R,C,V> Skeletal, implementation-agnostic implementation of theTableinterface.AllEqualOrdering An ordering that treats all references as equals, even nulls.ArrayListMultimap<K,V> Implementation ofMultimapthat uses anArrayListto store the values for a given key.ArrayListMultimapGwtSerializationDependencies<K,V> A dummy superclass to support GWT serialization of the element types of anArrayListMultimap.ArrayTable<R,C,V> Fixed-sizeTableimplementation backed by a two-dimensional array.ArrayTable.ArrayMap<K,V> BaseImmutableMultimap<K,V> A dummy superclass ofImmutableMultimapthat can be instanceof'd without ProGuard retaining additional implementation details ofImmutableMultimap.ByFunctionOrdering<F,T> An ordering that orders elements by applying an order to the result of a function on those elements.CartesianList<E> Implementation ofLists.cartesianProduct(List).CollectCollectors Collectors utilities forcommon.collectinternals.CollectCollectors.EnumMapAccumulator<K extends java.lang.Enum<K>,V> CollectCollectors.EnumSetAccumulator<E extends java.lang.Enum<E>> Collections2 Provides static methods for working withCollectioninstances.Collections2.FilteredCollection<E> Collections2.OrderedPermutationCollection<E> Collections2.OrderedPermutationIterator<E> Collections2.PermutationCollection<E> Collections2.PermutationIterator<E> Collections2.TransformedCollection<F,T> CollectPreconditions Precondition checks useful in collection implementations.CollectSpliterators Spliterator utilities forcommon.collectinternals.CollectSpliterators.FlatMapSpliterator<InElementT,OutElementT,OutSpliteratorT extends java.util.Spliterator<OutElementT>> Implements theStream#flatMapoperation on spliterators.CollectSpliterators.FlatMapSpliteratorOfDouble<InElementT> CollectSpliterators.FlatMapSpliteratorOfInt<InElementT> CollectSpliterators.FlatMapSpliteratorOfLong<InElementT> CollectSpliterators.FlatMapSpliteratorOfObject<InElementT,OutElementT> Implementation ofStream#flatMapwith an object spliterator output type.CollectSpliterators.FlatMapSpliteratorOfPrimitive<InElementT,OutElementT,OutConsumerT,OutSpliteratorT extends java.util.Spliterator.OfPrimitive<OutElementT,OutConsumerT,OutSpliteratorT>> Implementation ofStream#flatMapwith a primitive spliterator output type.CompactHashing Helper classes and static methods for implementing compact hash-based collections.CompactHashMap<K,V> CompactHashMap is an implementation of a Map.CompactHashSet<E> CompactHashSet is an implementation of a Set.CompactLinkedHashMap<K,V> CompactLinkedHashMap is an implementation of a Map with insertion or LRU iteration order, maintained with a doubly linked list through the entries.CompactLinkedHashSet<E> CompactLinkedHashSet is an implementation of a Set, which a predictable iteration order that matches the insertion order.ComparatorOrdering<T> An ordering for a pre-existing comparator.Comparators Provides static methods for working withComparatorinstances.ComparisonChain A utility for performing a chained comparison statement.ComparisonChain.InactiveComparisonChain CompoundOrdering<T> An ordering that tries several comparators in order.ConcurrentHashMultiset<E> A multiset that supports concurrent modifications and that provides atomic versions of mostMultisetoperations (exceptions where noted).ConcurrentHashMultiset.FieldSettersHolder ConsumingQueueIterator<T> An Iterator implementation which draws elements from a queue, removing them from the queue as it iterates.ContiguousSet<C extends java.lang.Comparable> A sorted set of contiguous values in a givenDiscreteDomain.Count A mutable value of typeint, for multisets to use in tracking counts of values.Cut<C extends java.lang.Comparable> Implementation detail for the internal structure ofRangeinstances.Cut.AboveAll Cut.AboveValue<C extends java.lang.Comparable> Cut.BelowAll Cut.BelowValue<C extends java.lang.Comparable> DenseImmutableTable<R,C,V> ARegularImmutableTableoptimized for dense data.DenseImmutableTable.ImmutableArrayMap<K,V> An immutable map implementation backed by an indexed nullable array.DescendingImmutableSortedMultiset<E> A descending wrapper around anImmutableSortedMultisetDescendingImmutableSortedSet<E> Skeletal implementation ofImmutableSortedSet.descendingSet().DescendingMultiset<E> A skeleton implementation of a descending multiset.DiscreteDomain<C extends java.lang.Comparable> A descriptor for a discreteComparabledomain such as allIntegerinstances.DiscreteDomain.BigIntegerDomain DiscreteDomain.IntegerDomain DiscreteDomain.LongDomain EmptyContiguousSet<C extends java.lang.Comparable> An empty contiguous set.EmptyContiguousSet.SerializedForm<C extends java.lang.Comparable> EmptyImmutableListMultimap Implementation ofImmutableListMultimapwith no entries.EmptyImmutableSetMultimap Implementation ofImmutableListMultimapwith no entries.EnumBiMap<K extends java.lang.Enum<K>,V extends java.lang.Enum<V>> ABiMapbacked by twoEnumMapinstances.EnumHashBiMap<K extends java.lang.Enum<K>,V> ABiMapbacked by anEnumMapinstance for keys-to-values, and aHashMapinstance for values-to-keys.EnumMultiset<E extends java.lang.Enum<E>> Multiset implementation specialized for enum elements, supporting all single-element operations in O(1).EvictingQueue<E> A non-blocking queue which automatically evicts elements from the head of the queue when attempting to add new elements onto the queue and it is full.ExplicitOrdering<T> An ordering that compares objects according to a given order.FilteredEntryMultimap<K,V> Implementation ofMultimaps.filterEntries(Multimap, Predicate).FilteredEntrySetMultimap<K,V> Implementation ofMultimaps.filterEntries(SetMultimap, Predicate).FilteredKeyListMultimap<K,V> Implementation ofMultimaps.filterKeys(ListMultimap, Predicate).FilteredKeyMultimap<K,V> Implementation ofMultimaps.filterKeys(Multimap, Predicate).FilteredKeyMultimap.AddRejectingList<K,V> FilteredKeyMultimap.AddRejectingSet<K,V> FilteredKeySetMultimap<K,V> Implementation ofMultimaps.filterKeys(SetMultimap, Predicate).FilteredMultimapValues<K,V> Implementation forMultimap.values().FluentIterable<E> A discouraged (but not deprecated) precursor to Java's superiorStreamlibrary.FluentIterable.FromIterableFunction<E> Function that transformsIterable<E>into a fluent iterable.ForwardingBlockingDeque<E> Deprecated. This class has moved tocom.google.common.util.concurrent.ForwardingCollection<E> A collection which forwards all its method calls to another collection.ForwardingConcurrentMap<K,V> A concurrent map which forwards all its method calls to another concurrent map.ForwardingDeque<E> A deque which forwards all its method calls to another deque.ForwardingImmutableCollection Dummy class that makes the GWT serialization policy happy.ForwardingImmutableList<E> Unused stub class, unreferenced under Java and manually emulated under GWT.ForwardingImmutableMap<K,V> Unused stub class, unreferenced under Java and manually emulated under GWT.ForwardingImmutableSet<E> Unused stub class, unreferenced under Java and manually emulated under GWT.ForwardingIterator<T> An iterator which forwards all its method calls to another iterator.ForwardingList<E> A list which forwards all its method calls to another list.ForwardingListIterator<E> A list iterator which forwards all its method calls to another list iterator.ForwardingListMultimap<K,V> A list multimap which forwards all its method calls to another list multimap.ForwardingMap<K,V> A map which forwards all its method calls to another map.ForwardingMapEntry<K,V> A map entry which forwards all its method calls to another map entry.ForwardingMultimap<K,V> A multimap which forwards all its method calls to another multimap.ForwardingMultiset<E> A multiset which forwards all its method calls to another multiset.ForwardingNavigableMap<K,V> A navigable map which forwards all its method calls to another navigable map.ForwardingNavigableSet<E> A navigable set which forwards all its method calls to another navigable set.ForwardingObject An abstract base class for implementing the decorator pattern.ForwardingQueue<E> A queue which forwards all its method calls to another queue.ForwardingSet<E> A set which forwards all its method calls to another set.ForwardingSetMultimap<K,V> A set multimap which forwards all its method calls to another set multimap.ForwardingSortedMap<K,V> A sorted map which forwards all its method calls to another sorted map.ForwardingSortedMultiset<E> A sorted multiset which forwards all its method calls to another sorted multiset.ForwardingSortedSet<E> A sorted set which forwards all its method calls to another sorted set.ForwardingSortedSetMultimap<K,V> A sorted set multimap which forwards all its method calls to another sorted set multimap.ForwardingTable<R,C,V> A table which forwards all its method calls to another table.GeneralRange<T> A generalized interval on any ordering, for internal use.HashBasedTable<R,C,V> Implementation ofTableusing linked hash tables.HashBasedTable.Factory<C,V> HashBiMap<K,V> ABiMapbacked by two hash tables.HashBiMap.BiEntry<K,V> HashBiMap.InverseSerializedForm<K,V> Hashing Static methods for implementing hash-based collections.HashMultimap<K,V> Implementation ofMultimapusing hash tables.HashMultimapGwtSerializationDependencies<K,V> A dummy superclass to support GWT serialization of the element types of aHashMultimap.HashMultiset<E> Multiset implementation backed by aHashMap.ImmutableAsList<E> List returned byImmutableCollection.asList()that delegatescontainschecks to the backing collection.ImmutableAsList.SerializedForm Serialized form that leads to the same performance as the original list.ImmutableBiMap<K,V> ABiMapwhose contents will never change, with many other important properties detailed atImmutableCollection.ImmutableBiMap.Builder<K,V> A builder for creating immutable bimap instances, especiallypublic static finalbimaps ("constant bimaps").ImmutableBiMap.SerializedForm<K,V> Serialized type for all ImmutableBiMap instances.ImmutableBiMapFauxverideShim<K,V> "Overrides" theImmutableMapstatic methods that lackImmutableBiMapequivalents with deprecated, exception-throwing versions.ImmutableClassToInstanceMap<B> AClassToInstanceMapwhose contents will never change, with many other important properties detailed atImmutableCollection.ImmutableClassToInstanceMap.Builder<B> A builder for creating immutable class-to-instance maps.ImmutableCollection<E> ACollectionwhose contents will never change, and which offers a few additional guarantees detailed below.ImmutableCollection.Builder<E> Abstract base class for builders ofImmutableCollectiontypes.ImmutableEntry<K,V> ImmutableEnumMap<K extends java.lang.Enum<K>,V> Implementation ofImmutableMapbacked by a non-emptyEnumMap.ImmutableEnumMap.EnumSerializedForm<K extends java.lang.Enum<K>,V> ImmutableEnumSet<E extends java.lang.Enum<E>> Implementation ofImmutableSetbacked by a non-emptyEnumSet.ImmutableEnumSet.EnumSerializedForm<E extends java.lang.Enum<E>> ImmutableList<E> AListwhose contents will never change, with many other important properties detailed atImmutableCollection.ImmutableList.Builder<E> A builder for creating immutable list instances, especiallypublic static finallists ("constant lists").ImmutableList.ReverseImmutableList<E> ImmutableList.SerializedForm ImmutableListMultimap<K,V> AListMultimapwhose contents will never change, with many other important properties detailed atImmutableCollection.ImmutableListMultimap.Builder<K,V> A builder for creating immutableListMultimapinstances, especiallypublic static finalmultimaps ("constant multimaps").ImmutableMap<K,V> AMapwhose contents will never change, with many other important properties detailed atImmutableCollection.ImmutableMap.Builder<K,V> A builder for creating immutable map instances, especiallypublic static finalmaps ("constant maps").ImmutableMap.IteratorBasedImmutableMap<K,V> ImmutableMap.SerializedForm<K,V> Serialized type for all ImmutableMap instances.ImmutableMapEntry<K,V> Implementation ofEntryforImmutableMapthat adds extra methods to traverse hash buckets for the key and the value.ImmutableMapEntry.NonTerminalImmutableBiMapEntry<K,V> ImmutableMapEntry.NonTerminalImmutableMapEntry<K,V> ImmutableMapEntrySet<K,V> entrySet()implementation forImmutableMap.ImmutableMapEntrySet.EntrySetSerializedForm<K,V> ImmutableMapEntrySet.RegularEntrySet<K,V> ImmutableMapKeySet<K,V> keySet()implementation forImmutableMap.ImmutableMapKeySet.KeySetSerializedForm<K> ImmutableMapValues<K,V> values()implementation forImmutableMap.ImmutableMapValues.SerializedForm<V> ImmutableMultimap<K,V> AMultimapwhose contents will never change, with many other important properties detailed atImmutableCollection.ImmutableMultimap.Builder<K,V> A builder for creating immutable multimap instances, especiallypublic static finalmultimaps ("constant multimaps").ImmutableMultimap.EntryCollection<K,V> ImmutableMultimap.FieldSettersHolder ImmutableMultimap.KeysSerializedForm ImmutableMultimap.Values<K,V> ImmutableMultiset<E> AMultisetwhose contents will never change, with many other important properties detailed atImmutableCollection.ImmutableMultiset.Builder<E> A builder for creating immutable multiset instances, especiallypublic static finalmultisets ("constant multisets").ImmutableMultiset.ElementSet<E> ImmutableMultiset.EntrySetSerializedForm<E> ImmutableMultiset.SerializedForm ImmutableMultisetGwtSerializationDependencies<E> A dummy superclass to support GWT serialization of the element type of anImmutableMultiset.ImmutableRangeMap<K extends java.lang.Comparable<?>,V> ARangeMapwhose contents will never change, with many other important properties detailed atImmutableCollection.ImmutableRangeMap.Builder<K extends java.lang.Comparable<?>,V> A builder for immutable range maps.ImmutableRangeMap.SerializedForm<K extends java.lang.Comparable<?>,V> This class is used to serialize ImmutableRangeMap instances.ImmutableRangeSet<C extends java.lang.Comparable> ARangeSetwhose contents will never change, with many other important properties detailed atImmutableCollection.ImmutableRangeSet.AsSetSerializedForm<C extends java.lang.Comparable> ImmutableRangeSet.Builder<C extends java.lang.Comparable<?>> A builder for immutable range sets.ImmutableRangeSet.SerializedForm<C extends java.lang.Comparable> ImmutableSet<E> ASetwhose contents will never change, with many other important properties detailed atImmutableCollection.ImmutableSet.Builder<E> A builder for creatingImmutableSetinstances.ImmutableSet.Indexed<E> ImmutableSet.JdkBackedSetBuilderImpl<E> SetBuilderImpl version that uses a JDK HashSet, which has built in hash flooding protection.ImmutableSet.RegularSetBuilderImpl<E> Default implementation of the guts of ImmutableSet.Builder, creating an open-addressed hash table and deduplicating elements as they come, so it only allocates O(max(distinct, expectedCapacity)) rather than O(calls to add).ImmutableSet.SerializedForm ImmutableSet.SetBuilderImpl<E> Swappable internal implementation of an ImmutableSet.Builder.ImmutableSetMultimap<K,V> ASetMultimapwhose contents will never change, with many other important properties detailed atImmutableCollection.ImmutableSetMultimap.Builder<K,V> A builder for creating immutableSetMultimapinstances, especiallypublic static finalmultimaps ("constant multimaps").ImmutableSetMultimap.EntrySet<K,V> ImmutableSetMultimap.SetFieldSettersHolder ImmutableSortedAsList<E> List returned byImmutableSortedSet.asList()when the set isn't empty.ImmutableSortedMap<K,V> ANavigableMapwhose contents will never change, with many other important properties detailed atImmutableCollection.ImmutableSortedMap.Builder<K,V> A builder for creating immutable sorted map instances, especiallypublic static finalmaps ("constant maps").ImmutableSortedMap.SerializedForm<K,V> Serialized type for all ImmutableSortedMap instances.ImmutableSortedMapFauxverideShim<K,V> "Overrides" theImmutableMapstatic methods that lackImmutableSortedMapequivalents with deprecated, exception-throwing versions.ImmutableSortedMultiset<E> ASortedMultisetwhose contents will never change, with many other important properties detailed atImmutableCollection.ImmutableSortedMultiset.Builder<E> A builder for creating immutable multiset instances, especiallypublic static finalmultisets ("constant multisets").ImmutableSortedMultiset.SerializedForm<E> ImmutableSortedMultisetFauxverideShim<E> "Overrides" theImmutableMultisetstatic methods that lackImmutableSortedMultisetequivalents with deprecated, exception-throwing versions.ImmutableSortedSet<E> ANavigableSetwhose contents will never change, with many other important properties detailed atImmutableCollection.ImmutableSortedSet.Builder<E> A builder for creating immutable sorted set instances, especiallypublic static finalsets ("constant sets"), with a given comparator.ImmutableSortedSet.SerializedForm<E> ImmutableSortedSetFauxverideShim<E> "Overrides" theImmutableSetstatic methods that lackImmutableSortedSetequivalents with deprecated, exception-throwing versions.ImmutableTable<R,C,V> ATablewhose contents will never change, with many other important properties detailed atImmutableCollection.ImmutableTable.Builder<R,C,V> A builder for creating immutable table instances, especiallypublic static finaltables ("constant tables").ImmutableTable.SerializedForm Serialized type for all ImmutableTable instances.IndexedImmutableSet<E> Interners Contains static methods pertaining to instances ofInterner.Interners.InternerBuilder Builder forInternerinstances.Interners.InternerFunction<E> Interners.InternerImpl<E> Iterables An assortment of mainly legacy static utility methods that operate on or return objects of typeIterable.Iterables.UnmodifiableIterable<T> Iterators This class contains static utility methods that operate on or return objects of typeIterator.Iterators.ArrayItr<T> Iterators.ConcatenatedIterator<T> Iterators.MergingIterator<T> An iterator that performs a lazy N-way merge, calculating the next value each time the iterator is polled.Iterators.PeekingImpl<E> Implementation of PeekingIterator that avoids peeking unless necessary.JdkBackedImmutableBiMap<K,V> Implementation of ImmutableBiMap backed by a pair of JDK HashMaps, which have smartness protecting against hash flooding.JdkBackedImmutableMap<K,V> Implementation of ImmutableMap backed by a JDK HashMap, which has smartness protecting against hash flooding.JdkBackedImmutableMultiset<E> An implementation of ImmutableMultiset backed by a JDK Map and a list of entries.JdkBackedImmutableSet<E> ImmutableSet implementation backed by a JDK HashSet, used to defend against apparent hash flooding.LexicographicalOrdering<T> An ordering which sorts iterables by comparing corresponding elements pairwise.LinkedHashMultimap<K,V> Implementation ofMultimapthat does not allow duplicate key-value entries and that returns collections whose iterators follow the ordering in which the data was added to the multimap.LinkedHashMultimap.ValueEntry<K,V> LinkedHashMultimap entries are in no less than three coexisting linked lists: a bucket in the hash table for aSet<V>associated with a key, the linked list of insertion-ordered entries in thatSet<V>, and the linked list of entries in the LinkedHashMultimap as a whole.LinkedHashMultimapGwtSerializationDependencies<K,V> A dummy superclass to support GWT serialization of the element types of aLinkedHashMultimap.LinkedHashMultiset<E> AMultisetimplementation with predictable iteration order.LinkedListMultimap<K,V> An implementation ofListMultimapthat supports deterministic iteration order for both keys and values.LinkedListMultimap.KeyList<K,V> LinkedListMultimap.Node<K,V> Lists Static utility methods pertaining toListinstances.Lists.AbstractListWrapper<E> Lists.CharSequenceAsList Lists.OnePlusArrayList<E> Lists.Partition<T> Lists.RandomAccessListWrapper<E> Lists.RandomAccessPartition<T> Lists.RandomAccessReverseList<T> Lists.ReverseList<T> Lists.StringAsImmutableList Lists.TransformingRandomAccessList<F,T> Implementation of a transforming random access list.Lists.TransformingSequentialList<F,T> Implementation of a sequential transforming list.Lists.TwoPlusArrayList<E> MapMaker A builder ofConcurrentMapinstances that can have keys or values automatically wrapped in weak references.MapMakerInternalMap<K,V,E extends MapMakerInternalMap.InternalEntry<K,V,E>,S extends MapMakerInternalMap.Segment<K,V,E,S>> The concurrent hash map implementation built byMapMaker.MapMakerInternalMap.AbstractSerializationProxy<K,V> The actual object that gets serialized.MapMakerInternalMap.AbstractStrongKeyEntry<K,V,E extends MapMakerInternalMap.InternalEntry<K,V,E>> Base class forMapMakerInternalMap.InternalEntryimplementations for strong keys.MapMakerInternalMap.AbstractWeakKeyEntry<K,V,E extends MapMakerInternalMap.InternalEntry<K,V,E>> Base class forMapMakerInternalMap.InternalEntryimplementations for weak keys.MapMakerInternalMap.CleanupMapTask MapMakerInternalMap.DummyInternalEntry A dummy implementation ofMapMakerInternalMap.InternalEntry, solely for use in the type signature ofMapMakerInternalMap.UNSET_WEAK_VALUE_REFERENCEbelow.MapMakerInternalMap.SafeToArraySet<E> MapMakerInternalMap.Segment<K,V,E extends MapMakerInternalMap.InternalEntry<K,V,E>,S extends MapMakerInternalMap.Segment<K,V,E,S>> Segments are specialized versions of hash tables.MapMakerInternalMap.SerializationProxy<K,V> The actual object that gets serialized.MapMakerInternalMap.StrongKeyDummyValueEntry<K> Concrete implementation ofMapMakerInternalMap.InternalEntryfor strong keys andMapMaker.Dummyvalues.MapMakerInternalMap.StrongKeyDummyValueEntry.Helper<K> Concrete implementation ofMapMakerInternalMap.InternalEntryHelperfor strong keys andMapMaker.Dummyvalues.MapMakerInternalMap.StrongKeyDummyValueSegment<K> Concrete implementation ofMapMakerInternalMap.Segmentfor strong keys andMapMaker.Dummyvalues.MapMakerInternalMap.StrongKeyStrongValueEntry<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntryfor strong keys and strong values.MapMakerInternalMap.StrongKeyStrongValueEntry.Helper<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntryHelperfor strong keys and strong values.MapMakerInternalMap.StrongKeyStrongValueSegment<K,V> Concrete implementation ofMapMakerInternalMap.Segmentfor strong keys and strong values.MapMakerInternalMap.StrongKeyWeakValueEntry<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntryfor strong keys and weak values.MapMakerInternalMap.StrongKeyWeakValueEntry.Helper<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntryHelperfor strong keys and weak values.MapMakerInternalMap.StrongKeyWeakValueSegment<K,V> Concrete implementation ofMapMakerInternalMap.Segmentfor strong keys and weak values.MapMakerInternalMap.WeakKeyDummyValueEntry<K> Concrete implementation ofMapMakerInternalMap.InternalEntryfor weak keys andMapMaker.Dummyvalues.MapMakerInternalMap.WeakKeyDummyValueEntry.Helper<K> Concrete implementation ofMapMakerInternalMap.InternalEntryHelperfor weak keys andMapMaker.Dummyvalues.MapMakerInternalMap.WeakKeyDummyValueSegment<K> Concrete implementation ofMapMakerInternalMap.Segmentfor weak keys andMapMaker.Dummyvalues.MapMakerInternalMap.WeakKeyStrongValueEntry<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntryfor weak keys and strong values.MapMakerInternalMap.WeakKeyStrongValueEntry.Helper<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntryHelperfor weak keys and strong values.MapMakerInternalMap.WeakKeyStrongValueSegment<K,V> Concrete implementation ofMapMakerInternalMap.Segmentfor weak keys and strong values.MapMakerInternalMap.WeakKeyWeakValueEntry<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntryfor weak keys and weak values.MapMakerInternalMap.WeakKeyWeakValueEntry.Helper<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntryHelperfor weak keys and weak values.MapMakerInternalMap.WeakKeyWeakValueSegment<K,V> Concrete implementation ofMapMakerInternalMap.Segmentfor weak keys and weak values.MapMakerInternalMap.WeakValueReferenceImpl<K,V,E extends MapMakerInternalMap.InternalEntry<K,V,E>> Concrete implementation ofMapMakerInternalMap.WeakValueReference.Maps Maps.AbstractFilteredMap<K,V> Maps.AsMapView<K,V> Maps.BiMapConverter<A,B> Maps.DescendingMap<K,V> Maps.EntrySet<K,V> Maps.FilteredEntryBiMap<K,V> Maps.FilteredEntryMap<K,V> Maps.FilteredEntryNavigableMap<K,V> Maps.FilteredEntrySortedMap<K,V> Maps.FilteredKeyMap<K,V> Maps.FilteredMapValues<K,V> Maps.IteratorBasedAbstractMap<K,V> Maps.KeySet<K,V> Maps.MapDifferenceImpl<K,V> Maps.NavigableAsMapView<K,V> Maps.NavigableKeySet<K,V> Maps.SortedAsMapView<K,V> Maps.SortedKeySet<K,V> Maps.SortedMapDifferenceImpl<K,V> Maps.TransformedEntriesMap<K,V1,V2> Maps.TransformedEntriesNavigableMap<K,V1,V2> Maps.TransformedEntriesSortedMap<K,V1,V2> Maps.UnmodifiableBiMap<K,V> Maps.UnmodifiableEntries<K,V> Maps.UnmodifiableEntrySet<K,V> Maps.UnmodifiableNavigableMap<K,V> Maps.ValueDifferenceImpl<V> Maps.Values<K,V> Maps.ViewCachingAbstractMap<K,V> AbstractMapextension that makes it easy to cache customized keySet, values, and entrySet views.MinMaxPriorityQueue<E> A double-ended priority queue, which provides constant-time access to both its least element and its greatest element, as determined by the queue's specified comparator.MinMaxPriorityQueue.Builder<B> The builder class used in creation of min-max priority queues.MinMaxPriorityQueue.MoveDesc<E> MoreCollectors Collectors not present injava.util.stream.Collectorsthat are not otherwise associated with acom.google.commontype.MoreCollectors.ToOptionalState This atrocity is here to let us report several of the elements in the stream if there were more than one, not just two.MultimapBuilder<K0,V0> A builder for a multimap implementation that allows customization of the backing map and value collection implementations used in a particular multimap.MultimapBuilder.ArrayListSupplier<V> MultimapBuilder.EnumSetSupplier<V extends java.lang.Enum<V>> MultimapBuilder.HashSetSupplier<V> MultimapBuilder.LinkedHashSetSupplier<V> MultimapBuilder.ListMultimapBuilder<K0,V0> A specialization ofMultimapBuilderthat generatesListMultimapinstances.MultimapBuilder.MultimapBuilderWithKeys<K0> An intermediate stage in aMultimapBuilderin which the key-value collection map implementation has been specified, but the value collection implementation has not.MultimapBuilder.SetMultimapBuilder<K0,V0> A specialization ofMultimapBuilderthat generatesSetMultimapinstances.MultimapBuilder.SortedSetMultimapBuilder<K0,V0> A specialization ofMultimapBuilderthat generatesSortedSetMultimapinstances.MultimapBuilder.TreeSetSupplier<V> Multimaps Provides static methods acting on or generating aMultimap.Multimaps.AsMap<K,V> A skeleton implementation ofMultimap.asMap().Multimaps.CustomListMultimap<K,V> Multimaps.CustomMultimap<K,V> Multimaps.CustomSetMultimap<K,V> Multimaps.CustomSortedSetMultimap<K,V> Multimaps.Entries<K,V> A skeleton implementation ofMultimap.entries().Multimaps.Keys<K,V> Multimaps.MapMultimap<K,V> Multimaps.TransformedEntriesListMultimap<K,V1,V2> Multimaps.TransformedEntriesMultimap<K,V1,V2> Multimaps.UnmodifiableListMultimap<K,V> Multimaps.UnmodifiableMultimap<K,V> Multimaps.UnmodifiableSetMultimap<K,V> Multimaps.UnmodifiableSortedSetMultimap<K,V> Multisets Provides static utility methods for creating and working withMultisetinstances.Multisets.AbstractEntry<E> Multisets.DecreasingCount Multisets.ElementSet<E> Multisets.EntrySet<E> Multisets.FilteredMultiset<E> Multisets.ImmutableEntry<E> Multisets.MultisetIteratorImpl<E> Multisets.UnmodifiableMultiset<E> Multisets.ViewMultiset<E> AnAbstractMultisetwith additional default implementations, some of them linear-time implementations in terms ofelementSetandentrySet.MutableClassToInstanceMap<B> A mutable class-to-instance map backed by an arbitrary user-provided map.MutableClassToInstanceMap.SerializedForm<B> Serialized form of the map, to avoid serializing the constraint.NaturalOrdering An ordering that uses the natural order of the values.NullsFirstOrdering<T> An ordering that treatsnullas less than all other values.NullsLastOrdering<T> An ordering that treatsnullas greater than all other values.ObjectArrays Static utility methods pertaining to object arrays.Ordering<T> A comparator, with additional methods to support common operations.Ordering.ArbitraryOrdering Ordering.ArbitraryOrderingHolder Platform Methods factored out so that they can be emulated differently in GWT.Queues Static utility methods pertaining toQueueandDequeinstances.Range<C extends java.lang.Comparable> A range (or "interval") defines the boundaries around a contiguous span of values of someComparabletype; for example, "integers from 1 to 100 inclusive." Note that it is not possible to iterate over these contained values.Range.LowerBoundFn Range.RangeLexOrdering Needed to serialize sorted collections of Ranges.Range.UpperBoundFn RangeGwtSerializationDependencies<C extends java.lang.Comparable> A dummy superclass to support GWT serialization of the element type of aRange.RegularContiguousSet<C extends java.lang.Comparable> An implementation ofContiguousSetthat contains one or more elements.RegularContiguousSet.SerializedForm<C extends java.lang.Comparable> RegularImmutableAsList<E> AnImmutableAsListimplementation specialized for when the delegate collection is already backed by anImmutableListor array.RegularImmutableBiMap<K,V> Bimap with zero or more mappings.RegularImmutableBiMap.InverseSerializedForm<K,V> RegularImmutableList<E> Implementation ofImmutableListbacked by a simple array.RegularImmutableMap<K,V> Implementation ofImmutableMapwith two or more entries.RegularImmutableMap.KeySet<K> RegularImmutableMap.KeySet.SerializedForm<K> RegularImmutableMap.Values<K,V> RegularImmutableMap.Values.SerializedForm<V> RegularImmutableMultiset<E> Implementation ofImmutableMultisetwith zero or more elements.RegularImmutableMultiset.NonTerminalEntry<E> RegularImmutableSet<E> Implementation ofImmutableSetwith two or more elements.RegularImmutableSortedMultiset<E> An immutable sorted multiset with one or more distinct elements.RegularImmutableSortedSet<E> An immutable sorted set with one or more elements.RegularImmutableTable<R,C,V> An implementation ofImmutableTableholding an arbitrary number of cells.ReverseNaturalOrdering An ordering that uses the reverse of the natural order of the values.ReverseOrdering<T> An ordering that uses the reverse of a given order.Serialization Provides static methods for serializing collection classes.Serialization.FieldSetter<T> Sets Static utility methods pertaining toSetinstances.Sets.CartesianSet<E> Sets.DescendingSet<E> Sets.FilteredNavigableSet<E> Sets.FilteredSet<E> Sets.FilteredSortedSet<E> Sets.ImprovedAbstractSet<E> AbstractSetsubstitute without the potentially-quadraticremoveAllimplementation.Sets.PowerSet<E> Sets.SetView<E> An unmodifiable view of a set which may be backed by other sets; this view will change as the backing sets do.Sets.SubSet<E> Sets.UnmodifiableNavigableSet<E> SingletonImmutableBiMap<K,V> Implementation ofImmutableMapwith exactly one entry.SingletonImmutableList<E> Implementation ofImmutableListwith exactly one element.SingletonImmutableSet<E> Implementation ofImmutableSetwith exactly one element.SingletonImmutableTable<R,C,V> An implementation ofImmutableTablethat holds a single cell.SortedIterables Utilities for dealing with sorted collections of all types.SortedLists Static methods pertaining to sortedListinstances.SortedMultisets Provides static utility methods for creating and working withSortedMultisetinstances.SortedMultisets.ElementSet<E> A skeleton implementation forSortedMultiset.elementSet().SortedMultisets.NavigableElementSet<E> A skeleton navigable implementation forSortedMultiset.elementSet().SparseImmutableTable<R,C,V> ARegularImmutableTableoptimized for sparse data.StandardRowSortedTable<R,C,V> Implementation ofTablewhose iteration ordering across row keys is sorted by their natural ordering or by a supplied comparator.StandardTable<R,C,V> Tableimplementation backed by a map that associates row keys with column key / value secondary maps.Streams Static utility methods related toStreaminstances.Streams.MapWithIndexSpliterator<F extends java.util.Spliterator<?>,R,S extends Streams.MapWithIndexSpliterator<F,R,S>> Streams.TemporaryPair<A,B> Synchronized Synchronized collection views.Synchronized.SynchronizedAsMap<K,V> Synchronized.SynchronizedAsMapEntries<K,V> Synchronized.SynchronizedAsMapValues<V> Synchronized.SynchronizedBiMap<K,V> Synchronized.SynchronizedCollection<E> Synchronized.SynchronizedDeque<E> Synchronized.SynchronizedEntry<K,V> Synchronized.SynchronizedList<E> Synchronized.SynchronizedListMultimap<K,V> Synchronized.SynchronizedMap<K,V> Synchronized.SynchronizedMultimap<K,V> Synchronized.SynchronizedMultiset<E> Synchronized.SynchronizedNavigableMap<K,V> Synchronized.SynchronizedNavigableSet<E> Synchronized.SynchronizedObject Synchronized.SynchronizedQueue<E> Synchronized.SynchronizedRandomAccessList<E> Synchronized.SynchronizedSet<E> Synchronized.SynchronizedSetMultimap<K,V> Synchronized.SynchronizedSortedMap<K,V> Synchronized.SynchronizedSortedSet<E> Synchronized.SynchronizedSortedSetMultimap<K,V> Synchronized.SynchronizedTable<R,C,V> TableCollectors Collectors utilities forcommon.collect.Tableinternals.TableCollectors.ImmutableTableCollectorState<R,C,V> TableCollectors.MutableCell<R,C,V> Tables Provides static methods that involve aTable.Tables.AbstractCell<R,C,V> Tables.ImmutableCell<R,C,V> Tables.TransformedTable<R,C,V1,V2> Tables.TransposeTable<C,R,V> Tables.UnmodifiableRowSortedMap<R,C,V> Tables.UnmodifiableTable<R,C,V> TopKSelector<T> An accumulator that selects the "top"kelements added to it, relative to a provided comparator.TransformedIterator<F,T> An iterator that transforms a backing iterator; for internal use.TransformedListIterator<F,T> An iterator that transforms a backing list iterator; for internal use.TreeBasedTable<R,C,V> Implementation ofTablewhose row keys and column keys are ordered by their natural ordering or by supplied comparators.TreeBasedTable.Factory<C,V> TreeMultimap<K,V> Implementation ofMultimapwhose keys and values are ordered by their natural ordering or by supplied comparators.TreeMultiset<E> A multiset which maintains the ordering of its elements, according to either their natural order or an explicitComparator.TreeMultiset.AvlNode<E> TreeMultiset.Reference<T> TreeRangeMap<K extends java.lang.Comparable,V> An implementation ofRangeMapbased on aTreeMap, supporting all optional operations.TreeRangeMap.RangeMapEntry<K extends java.lang.Comparable,V> TreeRangeSet<C extends java.lang.Comparable<?>> An implementation ofRangeSetbacked by aTreeMap.TreeRangeSet.ComplementRangesByLowerBound<C extends java.lang.Comparable<?>> TreeRangeSet.RangesByUpperBound<C extends java.lang.Comparable<?>> TreeRangeSet.SubRangeSetRangesByLowerBound<C extends java.lang.Comparable<?>> TreeTraverser<T> Deprecated. UseTraverserinstead.TreeTraverser.PostOrderNode<T> UnmodifiableIterator<E> An iterator that does not supportUnmodifiableIterator.remove().UnmodifiableListIterator<E> A list iterator that does not supportUnmodifiableIterator.remove(),UnmodifiableListIterator.add(E), orUnmodifiableListIterator.set(E).UnmodifiableSortedMultiset<E> Implementation ofMultisets.unmodifiableSortedMultiset(SortedMultiset), split out into its own file so it can be GWT emulated (to deal with the differing elementSet() types in GWT and non-GWT).UsingToStringOrdering An ordering that uses the natural order of the string representation of the values. -
Enum Summary Enum Description AbstractIterator.State BoundType Indicates whether an endpoint of some range is contained in the range itself ("closed") or not ("open").Iterators.EmptyModifiableIterator This is an enum singleton rather than an anonymous class so ProGuard can figure out it's only referenced by emptyModifiableIterator().MapMaker.Dummy A dummy singleton value type used byInterners.MapMakerInternalMap.Strength Maps.EntryFunction MultimapBuilder.LinkedListSupplier SortedLists.KeyAbsentBehavior A specification for which index to return if the list contains no elements that compare as equal to the key.SortedLists.KeyPresentBehavior A specification for which index to return if the list contains at least one element that compares as equal to the key.TreeMultiset.Aggregate A function which can be summed across a subtree. -
Exception Summary Exception Description ComputationException Deprecated. This exception is no longer thrown bycom.google.common.Ordering.IncomparableValueException Exception thrown by aOrdering.explicit(List)orOrdering.explicit(Object, Object[])comparator when comparing a value outside the set of values it can compare. -
Annotation Types Summary Annotation Type Description GwtTransient Private replacement forcom.google.gwt.user.client.rpc.GwtTransientto work around build-system quirks.