@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
Map
that 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
Collection
that 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 ofMultimap
are left unspecified and are provided only by the subtypes mentioned below. ListMultimap
- An extension of
Multimap
which permits duplicate entries, supports random access of values for a particular key, and has partially order-dependent equality as defined byListMultimap.equals(Object)
.ListMultimap
takes its name from the fact that the collection of values associated with a given key fulfills theList
contract. SetMultimap
- An extension of
Multimap
which 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.SetMultimap
takes its name from the fact that the collection of values associated with a given key fulfills theSet
contract. SortedSetMultimap
- An extension of
SetMultimap
for 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
Map
that associates a raw type with an instance of that type.
Collection Implementations
of List
of Set
ImmutableSet
ImmutableSortedSet
ContiguousSet
(seeRange
)
of Map
of BiMap
of Multiset
ImmutableMultiset
ImmutableSortedMultiset
HashMultiset
LinkedHashMultiset
TreeMultiset
EnumMultiset
ConcurrentHashMultiset
of Multimap
ImmutableMultimap
ImmutableListMultimap
ImmutableSetMultimap
ArrayListMultimap
HashMultimap
TreeMultimap
LinkedHashMultimap
LinkedListMultimap
of Table
of ClassToInstanceMap
Classes of static utility methods
Comparison
Abstract implementations
AbstractIterator
AbstractSequentialIterator
ImmutableCollection
UnmodifiableIterator
UnmodifiableListIterator
Ranges
Other
Forwarding collections
ForwardingCollection
ForwardingConcurrentMap
ForwardingIterator
ForwardingList
ForwardingListIterator
ForwardingListMultimap
ForwardingMap
ForwardingMapEntry
ForwardingMultimap
ForwardingMultiset
ForwardingNavigableMap
ForwardingNavigableSet
ForwardingObject
ForwardingQueue
ForwardingSet
ForwardingSetMultimap
ForwardingSortedMap
ForwardingSortedMultiset
ForwardingSortedSet
ForwardingSortedSetMultimap
ForwardingTable
-
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.FlatMapSpliterator
instances.FilteredMultimap<K,V> An interface for all filtered multimap types.FilteredSetMultimap<K,V> A supertype for filteredSetMultimap
implementations.Interner<E> Provides similar behavior toString.intern()
for any immutable type.LinkedHashMultimap.ValueSetLink<K,V> ListMultimap<K,V> AMultimap
that 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.InternalEntry
instances in a type-safe and efficient manner.MapMakerInternalMap.StrongValueEntry<K,V,E extends MapMakerInternalMap.InternalEntry<K,V,E>> Marker interface forMapMakerInternalMap.InternalEntry
implementations for strong values.MapMakerInternalMap.WeakValueEntry<K,V,E extends MapMakerInternalMap.InternalEntry<K,V,E>> Marker interface forMapMakerInternalMap.InternalEntry
implementations 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 extendsTable
and whose rows are sorted.SetMultimap<K,V> AMultimap
that cannot hold duplicate key-value pairs.SortedIterable<T> AnIterable
whose 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> AMultiset
which maintains the ordering of its elements, according to either their natural order or an explicitComparator
.SortedMultisetBridge<E> Superinterface ofSortedMultiset
to introduce a bridge method forelementSet()
, to ensure binary compatibility with older Guava versions that specifiedelementSet()
to returnSortedSet
.SortedSetMultimap<K,V> ASetMultimap
whose set of values for a given key are kept sorted; that is, they comprise aSortedSet
.Streams.DoubleFunctionWithIndex<R> An analogue ofDoubleFunction
also accepting an index.Streams.FunctionWithIndex<T,R> An analogue ofFunction
also accepting an index.Streams.IntFunctionWithIndex<R> An analogue ofIntFunction
also accepting an index.Streams.LongFunctionWithIndex<R> An analogue ofLongFunction
also 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 backingMap
instances.AbstractBiMap.Inverse<K,V> The inverse of any otherAbstractBiMap
subclass.AbstractIndexedListIterator<E> This class provides a skeletal implementation of theListIterator
interface across a fixed number of elements that may be retrieved by position.AbstractIterator<T> This class provides a skeletal implementation of theIterator
interface, to make this interface easier to implement for certain types of data sources.AbstractListMultimap<K,V> Basic implementation of theListMultimap
interface.AbstractMapBasedMultimap<K,V> Basic implementation of theMultimap
interface.AbstractMapBasedMultiset<E> Basic implementation ofMultiset<E>
backed by an instance ofMap<E, Count>
.AbstractMapEntry<K,V> Implementation of theequals
,hashCode
, andtoString
methods ofEntry
.AbstractMultimap<K,V> A skeletonMultimap
implementation, not necessarily in terms of aMap
.AbstractMultiset<E> This class provides a skeletal implementation of theMultiset
interface.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 theIterator
interface for sequences whose next element can always be derived from the previous element.AbstractSetMultimap<K,V> Basic implementation of theSetMultimap
interface.AbstractSortedKeySortedSetMultimap<K,V> Basic implementation of aSortedSetMultimap
with a sorted key set.AbstractSortedMultiset<E> This class provides a skeletal implementation of theSortedMultiset
interface.AbstractSortedSetMultimap<K,V> Basic implementation of theSortedSetMultimap
interface.AbstractTable<R,C,V> Skeletal, implementation-agnostic implementation of theTable
interface.AllEqualOrdering An ordering that treats all references as equals, even nulls.ArrayListMultimap<K,V> Implementation ofMultimap
that uses anArrayList
to 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-sizeTable
implementation backed by a two-dimensional array.ArrayTable.ArrayMap<K,V> BaseImmutableMultimap<K,V> A dummy superclass ofImmutableMultimap
that 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.collect
internals.CollectCollectors.EnumMapAccumulator<K extends java.lang.Enum<K>,V> CollectCollectors.EnumSetAccumulator<E extends java.lang.Enum<E>> Collections2 Provides static methods for working withCollection
instances.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.collect
internals.CollectSpliterators.FlatMapSpliterator<InElementT,OutElementT,OutSpliteratorT extends java.util.Spliterator<OutElementT>> Implements theStream#flatMap
operation on spliterators.CollectSpliterators.FlatMapSpliteratorOfDouble<InElementT> CollectSpliterators.FlatMapSpliteratorOfInt<InElementT> CollectSpliterators.FlatMapSpliteratorOfLong<InElementT> CollectSpliterators.FlatMapSpliteratorOfObject<InElementT,OutElementT> Implementation ofStream#flatMap
with an object spliterator output type.CollectSpliterators.FlatMapSpliteratorOfPrimitive<InElementT,OutElementT,OutConsumerT,OutSpliteratorT extends java.util.Spliterator.OfPrimitive<OutElementT,OutConsumerT,OutSpliteratorT>> Implementation ofStream#flatMap
with 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 withComparator
instances.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 mostMultiset
operations (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 ofRange
instances.Cut.AboveAll Cut.AboveValue<C extends java.lang.Comparable> Cut.BelowAll Cut.BelowValue<C extends java.lang.Comparable> DenseImmutableTable<R,C,V> ARegularImmutableTable
optimized for dense data.DenseImmutableTable.ImmutableArrayMap<K,V> An immutable map implementation backed by an indexed nullable array.DescendingImmutableSortedMultiset<E> A descending wrapper around anImmutableSortedMultiset
DescendingImmutableSortedSet<E> Skeletal implementation ofImmutableSortedSet.descendingSet()
.DescendingMultiset<E> A skeleton implementation of a descending multiset.DiscreteDomain<C extends java.lang.Comparable> A descriptor for a discreteComparable
domain such as allInteger
instances.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 ofImmutableListMultimap
with no entries.EmptyImmutableSetMultimap Implementation ofImmutableListMultimap
with no entries.EnumBiMap<K extends java.lang.Enum<K>,V extends java.lang.Enum<V>> ABiMap
backed by twoEnumMap
instances.EnumHashBiMap<K extends java.lang.Enum<K>,V> ABiMap
backed by anEnumMap
instance for keys-to-values, and aHashMap
instance 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 superiorStream
library.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 ofTable
using linked hash tables.HashBasedTable.Factory<C,V> HashBiMap<K,V> ABiMap
backed by two hash tables.HashBiMap.BiEntry<K,V> HashBiMap.InverseSerializedForm<K,V> Hashing Static methods for implementing hash-based collections.HashMultimap<K,V> Implementation ofMultimap
using 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 delegatescontains
checks to the backing collection.ImmutableAsList.SerializedForm Serialized form that leads to the same performance as the original list.ImmutableBiMap<K,V> ABiMap
whose contents will never change, with many other important properties detailed atImmutableCollection
.ImmutableBiMap.Builder<K,V> A builder for creating immutable bimap instances, especiallypublic static final
bimaps ("constant bimaps").ImmutableBiMap.SerializedForm<K,V> Serialized type for all ImmutableBiMap instances.ImmutableBiMapFauxverideShim<K,V> "Overrides" theImmutableMap
static methods that lackImmutableBiMap
equivalents with deprecated, exception-throwing versions.ImmutableClassToInstanceMap<B> AClassToInstanceMap
whose 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> ACollection
whose contents will never change, and which offers a few additional guarantees detailed below.ImmutableCollection.Builder<E> Abstract base class for builders ofImmutableCollection
types.ImmutableEntry<K,V> ImmutableEnumMap<K extends java.lang.Enum<K>,V> Implementation ofImmutableMap
backed by a non-emptyEnumMap
.ImmutableEnumMap.EnumSerializedForm<K extends java.lang.Enum<K>,V> ImmutableEnumSet<E extends java.lang.Enum<E>> Implementation ofImmutableSet
backed by a non-emptyEnumSet
.ImmutableEnumSet.EnumSerializedForm<E extends java.lang.Enum<E>> ImmutableList<E> AList
whose contents will never change, with many other important properties detailed atImmutableCollection
.ImmutableList.Builder<E> A builder for creating immutable list instances, especiallypublic static final
lists ("constant lists").ImmutableList.ReverseImmutableList<E> ImmutableList.SerializedForm ImmutableListMultimap<K,V> AListMultimap
whose contents will never change, with many other important properties detailed atImmutableCollection
.ImmutableListMultimap.Builder<K,V> A builder for creating immutableListMultimap
instances, especiallypublic static final
multimaps ("constant multimaps").ImmutableMap<K,V> AMap
whose contents will never change, with many other important properties detailed atImmutableCollection
.ImmutableMap.Builder<K,V> A builder for creating immutable map instances, especiallypublic static final
maps ("constant maps").ImmutableMap.IteratorBasedImmutableMap<K,V> ImmutableMap.SerializedForm<K,V> Serialized type for all ImmutableMap instances.ImmutableMapEntry<K,V> Implementation ofEntry
forImmutableMap
that 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> AMultimap
whose contents will never change, with many other important properties detailed atImmutableCollection
.ImmutableMultimap.Builder<K,V> A builder for creating immutable multimap instances, especiallypublic static final
multimaps ("constant multimaps").ImmutableMultimap.EntryCollection<K,V> ImmutableMultimap.FieldSettersHolder ImmutableMultimap.KeysSerializedForm ImmutableMultimap.Values<K,V> ImmutableMultiset<E> AMultiset
whose contents will never change, with many other important properties detailed atImmutableCollection
.ImmutableMultiset.Builder<E> A builder for creating immutable multiset instances, especiallypublic static final
multisets ("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> ARangeMap
whose 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> ARangeSet
whose 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> ASet
whose contents will never change, with many other important properties detailed atImmutableCollection
.ImmutableSet.Builder<E> A builder for creatingImmutableSet
instances.ImmutableSet.CachingAsList<E> ImmutableSet.EmptySetBuilderImpl<E> 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> ASetMultimap
whose contents will never change, with many other important properties detailed atImmutableCollection
.ImmutableSetMultimap.Builder<K,V> A builder for creating immutableSetMultimap
instances, especiallypublic static final
multimaps ("constant multimaps").ImmutableSetMultimap.EntrySet<K,V> ImmutableSetMultimap.SetFieldSettersHolder ImmutableSortedAsList<E> List returned byImmutableSortedSet.asList()
when the set isn't empty.ImmutableSortedMap<K,V> ANavigableMap
whose 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 final
maps ("constant maps").ImmutableSortedMap.SerializedForm<K,V> Serialized type for all ImmutableSortedMap instances.ImmutableSortedMapFauxverideShim<K,V> "Overrides" theImmutableMap
static methods that lackImmutableSortedMap
equivalents with deprecated, exception-throwing versions.ImmutableSortedMultiset<E> ASortedMultiset
whose contents will never change, with many other important properties detailed atImmutableCollection
.ImmutableSortedMultiset.Builder<E> A builder for creating immutable multiset instances, especiallypublic static final
multisets ("constant multisets").ImmutableSortedMultiset.SerializedForm<E> ImmutableSortedMultisetFauxverideShim<E> "Overrides" theImmutableMultiset
static methods that lackImmutableSortedMultiset
equivalents with deprecated, exception-throwing versions.ImmutableSortedSet<E> ANavigableSet
whose contents will never change, with many other important properties detailed atImmutableCollection
.ImmutableSortedSet.Builder<E> A builder for creating immutable sorted set instances, especiallypublic static final
sets ("constant sets"), with a given comparator.ImmutableSortedSet.SerializedForm<E> ImmutableSortedSetFauxverideShim<E> "Overrides" theImmutableSet
static methods that lackImmutableSortedSet
equivalents with deprecated, exception-throwing versions.ImmutableTable<R,C,V> ATable
whose 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 final
tables ("constant tables").ImmutableTable.SerializedForm Serialized type for all ImmutableTable instances.IndexedImmutableSet<E> Interners Contains static methods pertaining to instances ofInterner
.Interners.InternerBuilder Builder forInterner
instances.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 ofMultimap
that 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> AMultiset
implementation with predictable iteration order.LinkedListMultimap<K,V> An implementation ofListMultimap
that supports deterministic iteration order for both keys and values.LinkedListMultimap.KeyList<K,V> LinkedListMultimap.Node<K,V> Lists Static utility methods pertaining toList
instances.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 ofConcurrentMap
instances 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.InternalEntry
implementations for strong keys.MapMakerInternalMap.AbstractWeakKeyEntry<K,V,E extends MapMakerInternalMap.InternalEntry<K,V,E>> Base class forMapMakerInternalMap.InternalEntry
implementations for weak keys.MapMakerInternalMap.CleanupMapTask MapMakerInternalMap.DummyInternalEntry A dummy implementation ofMapMakerInternalMap.InternalEntry
, solely for use in the type signature ofMapMakerInternalMap.UNSET_WEAK_VALUE_REFERENCE
below.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.InternalEntry
for strong keys andMapMaker.Dummy
values.MapMakerInternalMap.StrongKeyDummyValueEntry.Helper<K> Concrete implementation ofMapMakerInternalMap.InternalEntryHelper
for strong keys andMapMaker.Dummy
values.MapMakerInternalMap.StrongKeyDummyValueSegment<K> Concrete implementation ofMapMakerInternalMap.Segment
for strong keys andMapMaker.Dummy
values.MapMakerInternalMap.StrongKeyStrongValueEntry<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntry
for strong keys and strong values.MapMakerInternalMap.StrongKeyStrongValueEntry.Helper<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntryHelper
for strong keys and strong values.MapMakerInternalMap.StrongKeyStrongValueSegment<K,V> Concrete implementation ofMapMakerInternalMap.Segment
for strong keys and strong values.MapMakerInternalMap.StrongKeyWeakValueEntry<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntry
for strong keys and weak values.MapMakerInternalMap.StrongKeyWeakValueEntry.Helper<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntryHelper
for strong keys and weak values.MapMakerInternalMap.StrongKeyWeakValueSegment<K,V> Concrete implementation ofMapMakerInternalMap.Segment
for strong keys and weak values.MapMakerInternalMap.WeakKeyDummyValueEntry<K> Concrete implementation ofMapMakerInternalMap.InternalEntry
for weak keys andMapMaker.Dummy
values.MapMakerInternalMap.WeakKeyDummyValueEntry.Helper<K> Concrete implementation ofMapMakerInternalMap.InternalEntryHelper
for weak keys andMapMaker.Dummy
values.MapMakerInternalMap.WeakKeyDummyValueSegment<K> Concrete implementation ofMapMakerInternalMap.Segment
for weak keys andMapMaker.Dummy
values.MapMakerInternalMap.WeakKeyStrongValueEntry<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntry
for weak keys and strong values.MapMakerInternalMap.WeakKeyStrongValueEntry.Helper<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntryHelper
for weak keys and strong values.MapMakerInternalMap.WeakKeyStrongValueSegment<K,V> Concrete implementation ofMapMakerInternalMap.Segment
for weak keys and strong values.MapMakerInternalMap.WeakKeyWeakValueEntry<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntry
for weak keys and weak values.MapMakerInternalMap.WeakKeyWeakValueEntry.Helper<K,V> Concrete implementation ofMapMakerInternalMap.InternalEntryHelper
for weak keys and weak values.MapMakerInternalMap.WeakKeyWeakValueSegment<K,V> Concrete implementation ofMapMakerInternalMap.Segment
for 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> AbstractMap
extension 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.Collectors
that are not otherwise associated with acom.google.common
type.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 ofMultimapBuilder
that generatesListMultimap
instances.MultimapBuilder.MultimapBuilderWithKeys<K0> An intermediate stage in aMultimapBuilder
in which the key-value collection map implementation has been specified, but the value collection implementation has not.MultimapBuilder.SetMultimapBuilder<K0,V0> A specialization ofMultimapBuilder
that generatesSetMultimap
instances.MultimapBuilder.SortedSetMultimapBuilder<K0,V0> A specialization ofMultimapBuilder
that generatesSortedSetMultimap
instances.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 withMultiset
instances.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> AnAbstractMultiset
with additional default implementations, some of them linear-time implementations in terms ofelementSet
andentrySet
.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.NullnessCasts A utility method to perform unchecked casts to suppress errors produced by nullness analyses.NullsFirstOrdering<T> An ordering that treatsnull
as less than all other values.NullsLastOrdering<T> An ordering that treatsnull
as 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 toQueue
andDeque
instances.Range<C extends java.lang.Comparable> A range (or "interval") defines the boundaries around a contiguous span of values of someComparable
type; 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 ofContiguousSet
that contains one or more elements.RegularContiguousSet.SerializedForm<C extends java.lang.Comparable> RegularImmutableAsList<E> AnImmutableAsList
implementation specialized for when the delegate collection is already backed by anImmutableList
or array.RegularImmutableBiMap<K,V> Bimap with zero or more mappings.RegularImmutableBiMap.InverseSerializedForm<K,V> RegularImmutableList<E> Implementation ofImmutableList
backed by a simple array.RegularImmutableMap<K,V> Implementation ofImmutableMap
with two or more entries.RegularImmutableMap.KeySet<K> RegularImmutableMap.KeySet.SerializedForm<K> RegularImmutableMap.Values<K,V> RegularImmutableMap.Values.SerializedForm<V> RegularImmutableMultiset<E> Implementation ofImmutableMultiset
with zero or more elements.RegularImmutableMultiset.NonTerminalEntry<E> RegularImmutableSet<E> Implementation ofImmutableSet
with 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 ofImmutableTable
holding 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 toSet
instances.Sets.CartesianSet<E> Sets.DescendingSet<E> Sets.FilteredNavigableSet<E> Sets.FilteredSet<E> Sets.FilteredSortedSet<E> Sets.ImprovedAbstractSet<E> AbstractSet
substitute without the potentially-quadraticremoveAll
implementation.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 ofImmutableMap
with exactly one entry.SingletonImmutableList<E> Implementation ofImmutableList
with exactly one element.SingletonImmutableSet<E> Implementation ofImmutableSet
with exactly one element.SingletonImmutableTable<R,C,V> An implementation ofImmutableTable
that holds a single cell.SortedIterables Utilities for dealing with sorted collections of all types.SortedLists Static methods pertaining to sortedList
instances.SortedMultisets Provides static utility methods for creating and working withSortedMultiset
instances.SortedMultisets.ElementSet<E> A skeleton implementation forSortedMultiset.elementSet()
.SortedMultisets.NavigableElementSet<E> A skeleton navigable implementation forSortedMultiset.elementSet()
.SparseImmutableTable<R,C,V> ARegularImmutableTable
optimized for sparse data.StandardRowSortedTable<R,C,V> Implementation ofTable
whose iteration ordering across row keys is sorted by their natural ordering or by a supplied comparator.StandardTable<R,C,V> Table
implementation backed by a map that associates row keys with column key / value secondary maps.Streams Static utility methods related toStream
instances.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.Table
internals.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"k
elements 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 ofTable
whose row keys and column keys are ordered by their natural ordering or by supplied comparators.TreeBasedTable.Factory<C,V> TreeMultimap<K,V> Implementation ofMultimap
whose 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 ofRangeMap
based on aTreeMap
, supporting all optional operations.TreeRangeMap.RangeMapEntry<K extends java.lang.Comparable,V> TreeRangeSet<C extends java.lang.Comparable<?>> An implementation ofRangeSet
backed 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. UseTraverser
instead.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 ElementTypesAreNonnullByDefault Marks all "top-level" types as non-null in a way that is recognized by Kotlin.GwtTransient Private replacement forcom.google.gwt.user.client.rpc.GwtTransient
to work around build-system quirks.ParametricNullness Marks a "top-level" type-variable usage as (a) a Kotlin platform type when the type argument is non-nullable and (b) nullable when the type argument is nullable.