Package | Description |
---|---|
com.google.common.annotations |
Common annotation types.
|
com.google.common.base |
Basic utility libraries and interfaces.
|
com.google.common.cache |
This package contains caching utilities.
|
com.google.common.collect |
This package contains generic collection interfaces and implementations, and
other utilities for working with collections.
|
com.google.common.eventbus |
The EventBus allows publish-subscribe-style communication between components
without requiring the components to explicitly register with one another
(and thus be aware of each other).
|
com.google.common.hash |
Hash functions and related structures.
|
com.google.common.io |
This package contains utility methods and classes for working with Java I/O,
for example input streams, output streams, readers, writers, and files.
|
com.google.common.math |
Arithmetic functions operating on primitive values and
BigInteger instances. |
com.google.common.net |
This package contains utility methods and classes for working with net
addresses (numeric IP and domain names).
|
com.google.common.primitives |
Static utilities for working with the eight primitive types and
void . |
com.google.common.util.concurrent |
Concurrency utilities.
|
Modifier and Type | Class and Description |
---|---|
interface |
Beta
Signifies that a public API (public class, method or field) is subject to
incompatible changes, or even removal, in a future release.
|
Modifier and Type | Class and Description |
---|---|
class |
CharMatcher
|
class |
Enums
Utility methods for working with
Enum instances. |
class |
Equivalence<T>
A strategy for determining whether two instances are considered equivalent.
|
static class |
Equivalence.Wrapper<T>
Wraps an object so that
Equivalence.Wrapper.equals(Object) and Equivalence.Wrapper.hashCode() delegate to an
Equivalence . |
class |
Equivalences
Contains static factory methods for creating
Equivalence instances. |
class |
Optional<T>
An immutable object that may contain a non-null reference to another object.
|
static class |
Splitter.MapSplitter
An object that splits strings into maps as
Splitter splits
iterables and lists. |
class |
Stopwatch
An object that measures elapsed time in nanoseconds.
|
class |
Ticker
A time source; returns a time value representing the number of nanoseconds
elapsed since some fixed but arbitrary point in time.
|
Modifier and Type | Field and Description |
---|---|
static int |
Ascii.MAX
The maximum value of an ASCII character.
|
static int |
Ascii.MIN
The minimum value of an ASCII character.
|
Modifier and Type | Method and Description |
---|---|
<A extends Appendable,I extends Object & Iterable<?> & Iterator<?>> |
Joiner.appendTo(A appendable,
I parts)
Deprecated.
use
Joiner.appendTo(Appendable, Iterator) by casting parts to
Iterator<?> , or better yet, by implementing only Iterator and not
Iterable . This method is scheduled for deletion in June 2013. |
<A extends Appendable,I extends Object & Iterable<? extends Map.Entry<?,?>> & Iterator<? extends Map.Entry<?,?>>> |
Joiner.MapJoiner.appendTo(A appendable,
I entries)
Deprecated.
use
Joiner.MapJoiner.appendTo(Appendable, Iterator) by casting entries to
Iterator<? extends Entry<?, ?>> , or better yet, by implementing only
Iterator and not Iterable . This method is scheduled for deletion
in June 2013. |
<A extends Appendable> |
Joiner.MapJoiner.appendTo(A appendable,
Iterable<? extends Map.Entry<?,?>> entries)
Appends the string representation of each entry in
entries , using the previously
configured separator and key-value separator, to appendable . |
<A extends Appendable> |
Joiner.appendTo(A appendable,
Iterator<?> parts)
Appends the string representation of each of
parts , using the previously configured
separator between each, to appendable . |
<A extends Appendable> |
Joiner.MapJoiner.appendTo(A appendable,
Iterator<? extends Map.Entry<?,?>> parts)
Appends the string representation of each entry in
entries , using the previously
configured separator and key-value separator, to appendable . |
<I extends Object & Iterable<?> & Iterator<?>> |
Joiner.appendTo(StringBuilder builder,
I parts)
Deprecated.
use
Joiner.appendTo(StringBuilder, Iterator) by casting parts to
Iterator<?> , or better yet, by implementing only Iterator and not
Iterable . This method is scheduled for deletion in June 2013. |
<I extends Object & Iterable<? extends Map.Entry<?,?>> & Iterator<? extends Map.Entry<?,?>>> |
Joiner.MapJoiner.appendTo(StringBuilder builder,
I entries)
Deprecated.
use
Joiner.MapJoiner.appendTo(StringBuilder, Iterator) by casting entries to
Iterator<? extends Entry<?, ?>> , or better yet, by implementing only
Iterator and not Iterable . This method is scheduled for deletion
in June 2013. |
StringBuilder |
Joiner.MapJoiner.appendTo(StringBuilder builder,
Iterable<? extends Map.Entry<?,?>> entries)
Appends the string representation of each entry in
entries , using the previously
configured separator and key-value separator, to builder . |
StringBuilder |
Joiner.appendTo(StringBuilder builder,
Iterator<?> parts)
Appends the string representation of each of
parts , using the previously configured
separator between each, to builder . |
StringBuilder |
Joiner.MapJoiner.appendTo(StringBuilder builder,
Iterator<? extends Map.Entry<?,?>> entries)
Appends the string representation of each entry in
entries , using the previously
configured separator and key-value separator, to builder . |
static Predicate<Class<?>> |
Predicates.assignableFrom(Class<?> clazz)
Returns a predicate that evaluates to
true if the class being
tested is assignable from the given class. |
static String |
Strings.commonPrefix(CharSequence a,
CharSequence b)
Returns the longest string
prefix such that
a.toString().startsWith(prefix) && b.toString().startsWith(prefix) ,
taking care not to split surrogate pairs. |
static String |
Strings.commonSuffix(CharSequence a,
CharSequence b)
Returns the longest string
suffix such that
a.toString().endsWith(suffix) && b.toString().endsWith(suffix) ,
taking care not to split surrogate pairs. |
static <T> Function<Object,T> |
Functions.forSupplier(Supplier<T> supplier)
Returns a function that always returns the result of invoking
Supplier.get() on supplier , regardless of its input. |
static List<Throwable> |
Throwables.getCausalChain(Throwable throwable)
Gets a
Throwable cause chain as a list. |
<I extends Object & Iterable<?> & Iterator<?>> |
Joiner.join(I parts)
Deprecated.
use
Joiner.join(Iterator) by casting parts to
Iterator<?> , or better yet, by implementing only Iterator and not
Iterable . This method is scheduled for deletion in June 2013. |
<I extends Object & Iterable<? extends Map.Entry<?,?>> & Iterator<? extends Map.Entry<?,?>>> |
Joiner.MapJoiner.join(I entries)
Deprecated.
use
Joiner.MapJoiner.join(Iterator) by casting entries to
Iterator<? extends Entry<?, ?>> , or better yet, by implementing only
Iterator and not Iterable . This method is scheduled for deletion
in June 2013. |
String |
Joiner.MapJoiner.join(Iterable<? extends Map.Entry<?,?>> entries)
Returns a string containing the string representation of each entry in
entries , using
the previously configured separator and key-value separator. |
String |
Joiner.join(Iterator<?> parts)
Returns a string containing the string representation of each of
parts , using the
previously configured separator between each. |
String |
Joiner.MapJoiner.join(Iterator<? extends Map.Entry<?,?>> entries)
Returns a string containing the string representation of each entry in
entries , using
the previously configured separator and key-value separator. |
static <T> Function<Supplier<T>,T> |
Suppliers.supplierFunction()
Returns a function that accepts a supplier and returns the result of
invoking
Supplier.get() on that supplier. |
Splitter.MapSplitter |
Splitter.withKeyValueSeparator(Splitter keyValueSplitter)
Returns a
MapSplitter which splits entries based on this splitter,
and splits entries into keys and values using the specified key-value
splitter. |
Splitter.MapSplitter |
Splitter.withKeyValueSeparator(String separator)
Returns a
MapSplitter which splits entries based on this splitter,
and splits entries into keys and values using the specified separator. |
Modifier and Type | Class and Description |
---|---|
class |
AbstractCache<K,V>
This class provides a skeletal implementation of the
Cache interface to minimize the
effort required to implement this interface. |
static class |
AbstractCache.SimpleStatsCounter
A thread-safe
AbstractCache.StatsCounter implementation for use by Cache implementors. |
static interface |
AbstractCache.StatsCounter
Accumulates statistics during the operation of a
Cache for presentation by Cache.stats() . |
class |
AbstractLoadingCache<K,V>
This class provides a skeletal implementation of the
Cache interface to minimize the
effort required to implement this interface. |
interface |
Cache<K,V>
A semi-persistent mapping from keys to values.
|
class |
CacheBuilder<K,V>
A builder of
LoadingCache and Cache instances having any combination of the
following features:
automatic loading of entries into the cache
least-recently-used eviction when a maximum size is exceeded
time-based expiration of entries, measured since last access or last write
keys automatically wrapped in weak references
values automatically wrapped in weak or
soft references
notification of evicted (or otherwise removed) entries
|
class |
CacheLoader<K,V>
Computes or retrieves values, based on a key, for use in populating a
Cache . |
class |
CacheStats
Statistics about the performance of a
Cache . |
class |
ForwardingCache<K,V>
A cache which forwards all its method calls to another cache.
|
static class |
ForwardingCache.SimpleForwardingCache<K,V>
A simplified version of
ForwardingCache where subclasses can pass in an already
constructed Cache as the delegete. |
class |
ForwardingLoadingCache<K,V>
A cache which forwards all its method calls to another cache.
|
static class |
ForwardingLoadingCache.SimpleForwardingLoadingCache<K,V>
A simplified version of
ForwardingLoadingCache where subclasses can pass in an already
constructed LoadingCache as the delegete. |
interface |
LoadingCache<K,V>
A semi-persistent mapping from keys to values.
|
class |
RemovalCause
The reason why a cached entry was removed.
|
interface |
RemovalListener<K,V>
An object that can receive a notification when an entry is removed from a cache.
|
class |
RemovalListeners
A collection of common removal listeners.
|
class |
RemovalNotification<K,V>
A notification of the removal of a single entry.
|
interface |
Weigher<K,V>
Calculates the weights of cache entries.
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractLinkedIterator<T>
This class provides a skeletal implementation of the
Iterator
interface for sequences whose next element can always be derived from the
previous element. |
class |
ArrayTable<R,C,V>
Fixed-size
Table implementation backed by a two-dimensional array. |
class |
BoundType
Indicates whether an endpoint of some range is contained in the range itself ("closed") or not
("open").
|
interface |
Constraint<E>
A constraint that an element must satisfy in order to be added to a
collection.
|
class |
Constraints
Factories and utilities pertaining to the
Constraint interface. |
class |
ContiguousSet<C extends Comparable>
A sorted set of contiguous values in a given
DiscreteDomain . |
class |
DiscreteDomain<C extends Comparable>
A descriptor for a discrete
Comparable domain such as all
Integer s. |
class |
DiscreteDomains
Factories for common
DiscreteDomain instances. |
protected class |
ForwardingMap.StandardEntrySet
A sensible implementation of
Map.entrySet() in terms of the following
methods: ForwardingMap.clear() , ForwardingMap.containsKey(java.lang.Object) ,
ForwardingMap.get(java.lang.Object) , ForwardingMap.isEmpty() , ForwardingMap.remove(java.lang.Object) , and ForwardingMap.size() . |
protected class |
ForwardingMap.StandardKeySet
A sensible implementation of
Map.keySet() in terms of the following
methods: ForwardingMap.clear() , ForwardingMap.containsKey(java.lang.Object) ,
ForwardingMap.isEmpty() , ForwardingMap.remove(java.lang.Object) , ForwardingMap.size() , and the Set.iterator() method of ForwardingMap.entrySet() . |
protected class |
ForwardingMap.StandardValues
A sensible implementation of
Map.values() in terms of the following
methods: ForwardingMap.clear() , ForwardingMap.containsValue(java.lang.Object) ,
ForwardingMap.isEmpty() , ForwardingMap.size() , and the Set.iterator() method of ForwardingMap.entrySet() . |
protected class |
ForwardingMultiset.StandardElementSet
A sensible implementation of
Multiset.elementSet() in terms of the
following methods: ForwardingCollection.clear() , ForwardingCollection.contains(java.lang.Object) , ForwardingCollection.containsAll(java.util.Collection<?>) ,
ForwardingMultiset.count(java.lang.Object) , ForwardingCollection.isEmpty() , the
Set.size() and Set.iterator() methods of ForwardingMultiset.entrySet() , and ForwardingMultiset.remove(Object,
int) . |
class |
ForwardingTable<R,C,V>
A table which forwards all its method calls to another table.
|
class |
GenericMapMaker<K0,V0>
A class exactly like
MapMaker , except restricted in the types of maps it can build. |
class |
HashBasedTable<R,C,V>
Implementation of
Table using hash tables. |
class |
ImmutableTable<R,C,V>
An immutable
Table with reliable user-specified iteration order. |
interface |
Interner<E>
Provides equivalent behavior to
String.intern() for other immutable
types. |
class |
Interners
Contains static methods pertaining to instances of
Interner . |
interface |
MapConstraint<K,V>
A constraint on the keys and values that may be added to a
Map or
Multimap . |
class |
MapConstraints
Factory and utilities pertaining to the
MapConstraint interface. |
class |
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.
|
static class |
MinMaxPriorityQueue.Builder<B>
The builder class used in creation of min-max priority queues.
|
class |
Queues
Static utility methods pertaining to
Queue
instances. |
class |
Range<C extends Comparable>
A range, sometimes known as an interval, is a convex
(informally, "contiguous" or "unbroken") portion of a particular domain.
|
class |
Ranges
Static methods pertaining to
Range instances. |
interface |
RowSortedTable<R,C,V>
Interface that extends
Table and whose rows are sorted. |
interface |
SortedMapDifference<K,V>
An object representing the differences between two sorted maps.
|
class |
SortedMaps
Deprecated.
Use the identical methods in
Maps . This class is
scheduled for deletion from Guava in Guava release 12.0. |
interface |
SortedMultiset<E>
A
Multiset which maintains the ordering of its elements, according to
either their natural order or an explicit Comparator . |
interface |
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.
|
static interface |
Table.Cell<R,C,V>
Row key / column key / value triplet corresponding to a mapping in a table.
|
class |
Tables
Provides static methods that involve a
Table . |
class |
TreeBasedTable<R,C,V>
Implementation of
Table whose row keys and column keys are ordered
by their natural ordering or by supplied comparators. |
Modifier and Type | Method and Description |
---|---|
static List<Character> |
Lists.charactersOf(CharSequence sequence)
Returns a view of the specified
CharSequence as a List<Character> , viewing sequence as a sequence of Unicode code
units. |
static ImmutableList<Character> |
Lists.charactersOf(String string)
Returns a view of the specified string as an immutable list of
Character values. |
static boolean |
Multisets.containsOccurrences(Multiset<?> superMultiset,
Multiset<?> subMultiset)
Returns
true if subMultiset.count(o) <=
superMultiset.count(o) for all o . |
static <E> ImmutableMultiset<E> |
Multisets.copyHighestCountFirst(Multiset<E> multiset)
Returns a copy of
multiset as an ImmutableMultiset whose iteration order is
highest count first, with ties broken by the iteration order of the original multiset. |
static <E> ConcurrentHashMultiset<E> |
ConcurrentHashMultiset.create(GenericMapMaker<? super E,? super Number> mapMaker)
Creates a new, empty
ConcurrentHashMultiset using mapMaker
to construct the internal backing map. |
static <K,V> MapDifference<K,V> |
Maps.difference(Map<? extends K,? extends V> left,
Map<? extends K,? extends V> right,
Equivalence<? super V> valueEquivalence)
Computes the difference between two maps.
|
static <K,V> SortedMapDifference<K,V> |
Maps.difference(SortedMap<K,? extends V> left,
Map<? extends K,? extends V> right)
Computes the difference between two sorted maps, using the comparator of
the left map, or
Ordering.natural() if the left map uses the
natural ordering of its elements. |
static <E> SortedSet<E> |
Sets.filter(SortedSet<E> unfiltered,
Predicate<? super E> predicate)
Returns the elements of a
SortedSet , unfiltered , that
satisfy a predicate. |
static <K,V> Multimap<K,V> |
Multimaps.filterEntries(Multimap<K,V> unfiltered,
Predicate<? super Map.Entry<K,V>> entryPredicate)
Returns a multimap containing the mappings in
unfiltered that
satisfy a predicate. |
static <K,V> SortedMap<K,V> |
Maps.filterEntries(SortedMap<K,V> unfiltered,
Predicate<? super Map.Entry<K,V>> entryPredicate)
Returns a sorted map containing the mappings in
unfiltered that
satisfy a predicate. |
static <K,V> Multimap<K,V> |
Multimaps.filterKeys(Multimap<K,V> unfiltered,
Predicate<? super K> keyPredicate)
Returns a multimap containing the mappings in
unfiltered whose keys
satisfy a predicate. |
static <K,V> SortedMap<K,V> |
Maps.filterKeys(SortedMap<K,V> unfiltered,
Predicate<? super K> keyPredicate)
Returns a sorted map containing the mappings in
unfiltered whose
keys satisfy a predicate. |
static <K,V> Multimap<K,V> |
Multimaps.filterValues(Multimap<K,V> unfiltered,
Predicate<? super V> valuePredicate)
Returns a multimap containing the mappings in
unfiltered whose values
satisfy a predicate. |
static <K,V> SortedMap<K,V> |
Maps.filterValues(SortedMap<K,V> unfiltered,
Predicate<? super V> valuePredicate)
Returns a sorted map containing the mappings in
unfiltered whose
values satisfy a predicate. |
<E extends T> |
Ordering.greatestOf(Iterable<E> iterable,
int k)
Returns the
k greatest elements of the given iterable according to
this ordering, in order from greatest to least. |
static <K,V,I extends Object & Iterable<V> & Iterator<V>> |
Multimaps.index(I values,
Function<? super V,K> keyFunction)
Deprecated.
use
Multimaps.index(Iterator, Function) by casting values to Iterator<V> , or better yet, by implementing only
Iterator and not Iterable . This method is scheduled
for deletion in March 2012. |
ImmutableSetMultimap<V,K> |
ImmutableSetMultimap.inverse()
Returns an immutable multimap which is the inverse of this one.
|
ImmutableListMultimap<V,K> |
ImmutableListMultimap.inverse()
Returns an immutable multimap which is the inverse of this one.
|
abstract ImmutableMultimap<V,K> |
ImmutableMultimap.inverse()
Returns an immutable multimap which is the inverse of this one.
|
<E extends T> |
Ordering.leastOf(Iterable<E> iterable,
int k)
Returns the
k least elements of the given iterable according to
this ordering, in order from least to greatest. |
<E extends T> |
Ordering.max(Iterator<E> iterator)
Returns the greatest of the specified values according to this ordering.
|
static <T> Iterable<T> |
Iterables.mergeSorted(Iterable<? extends Iterable<? extends T>> iterables,
Comparator<? super T> comparator)
Returns an iterable over the merged contents of all given
iterables . |
static <T> UnmodifiableIterator<T> |
Iterators.mergeSorted(Iterable<? extends Iterator<? extends T>> iterators,
Comparator<? super T> comparator)
Returns an iterator over the merged contents of all given
iterators , traversing every element of the input iterators. |
<E extends T> |
Ordering.min(Iterator<E> iterator)
Returns the least of the specified values according to this ordering.
|
ImmutableSetMultimap.Builder<K,V> |
ImmutableSetMultimap.Builder.orderKeysBy(Comparator<? super K> keyComparator)
Specifies the ordering of the generated multimap's keys.
|
ImmutableListMultimap.Builder<K,V> |
ImmutableListMultimap.Builder.orderKeysBy(Comparator<? super K> keyComparator)
Specifies the ordering of the generated multimap's keys.
|
ImmutableMultimap.Builder<K,V> |
ImmutableMultimap.Builder.orderKeysBy(Comparator<? super K> keyComparator)
Specifies the ordering of the generated multimap's keys.
|
ImmutableSetMultimap.Builder<K,V> |
ImmutableSetMultimap.Builder.orderValuesBy(Comparator<? super V> valueComparator)
Specifies the ordering of the generated multimap's values for each key.
|
ImmutableListMultimap.Builder<K,V> |
ImmutableListMultimap.Builder.orderValuesBy(Comparator<? super V> valueComparator)
Specifies the ordering of the generated multimap's values for each key.
|
ImmutableMultimap.Builder<K,V> |
ImmutableMultimap.Builder.orderValuesBy(Comparator<? super V> valueComparator)
Specifies the ordering of the generated multimap's values for each key.
|
static boolean |
Multisets.removeOccurrences(Multiset<?> multisetToModify,
Multiset<?> occurrencesToRemove)
For each occurrence of an element
e in occurrencesToRemove ,
removes one occurrence of e in multisetToModify . |
static boolean |
Multisets.retainOccurrences(Multiset<?> multisetToModify,
Multiset<?> multisetToRetain)
Modifies
multisetToModify so that its count for an element
e is at most multisetToRetain.count(e) . |
static <T> int |
Iterators.skip(Iterator<T> iterator,
int numberToSkip)
Calls
next() on iterator , either numberToSkip times
or until hasNext() returns false , whichever comes first. |
protected boolean |
ForwardingMultiset.standardAdd(E element)
A sensible definition of
ForwardingCollection.add(Object) in terms of ForwardingMultiset.add(Object, int) . |
protected boolean |
ForwardingList.standardAdd(E element)
A sensible default implementation of
ForwardingCollection.add(Object) , in terms of
ForwardingList.add(int, Object) . |
protected boolean |
ForwardingMultiset.standardAddAll(Collection<? extends E> elementsToAdd)
A sensible definition of
ForwardingCollection.addAll(Collection) in terms of ForwardingCollection.add(Object) and ForwardingMultiset.add(Object, int) . |
protected boolean |
ForwardingCollection.standardAddAll(Collection<? extends E> collection)
A sensible definition of
ForwardingCollection.addAll(java.util.Collection<? extends E>) in terms of ForwardingCollection.add(E) . |
protected boolean |
ForwardingList.standardAddAll(int index,
Iterable<? extends E> elements)
A sensible default implementation of
ForwardingList.addAll(int, Collection) , in
terms of the add method of ForwardingList.listIterator(int) . |
protected void |
ForwardingMultiset.standardClear()
A sensible definition of
ForwardingCollection.clear() in terms of the iterator
method of ForwardingMultiset.entrySet() . |
protected void |
ForwardingCollection.standardClear()
A sensible definition of
ForwardingCollection.clear() in terms of ForwardingCollection.iterator() ,
using the iterator's remove method. |
protected void |
ForwardingMap.standardClear()
A sensible definition of
ForwardingMap.clear() in terms of the iterator
method of ForwardingMap.entrySet() . |
protected boolean |
ForwardingMultiset.standardContains(Object object)
A sensible definition of
ForwardingCollection.contains(java.lang.Object) in terms of ForwardingMultiset.count(java.lang.Object) . |
protected boolean |
ForwardingCollection.standardContains(Object object)
A sensible definition of
ForwardingCollection.contains(java.lang.Object) in terms of ForwardingCollection.iterator() . |
protected boolean |
ForwardingSortedSet.standardContains(Object object)
A sensible definition of
ForwardingCollection.contains(java.lang.Object) in terms of the first()
method of ForwardingSortedSet.tailSet(E) . |
protected boolean |
ForwardingCollection.standardContainsAll(Collection<?> collection)
A sensible definition of
ForwardingCollection.containsAll(java.util.Collection<?>) in terms of ForwardingCollection.contains(java.lang.Object)
. |
protected boolean |
ForwardingSortedMap.standardContainsKey(Object key)
A sensible definition of
ForwardingMap.containsKey(java.lang.Object) in terms of the firstKey() method of ForwardingSortedMap.tailMap(K) . |
protected boolean |
ForwardingMap.standardContainsKey(Object key)
A sensible, albeit inefficient, definition of
ForwardingMap.containsKey(java.lang.Object) in terms
of the iterator method of ForwardingMap.entrySet() . |
protected boolean |
ForwardingMap.standardContainsValue(Object value)
A sensible definition of
ForwardingMap.containsValue(java.lang.Object) in terms of the iterator method of ForwardingMap.entrySet() . |
protected int |
ForwardingMultiset.standardCount(Object object)
A sensible, albeit inefficient, definition of
ForwardingMultiset.count(java.lang.Object) in terms of
ForwardingMultiset.entrySet() . |
protected boolean |
ForwardingMultiset.standardEquals(Object object)
A sensible, albeit inefficient, definition of
ForwardingCollection.size() in terms of
entrySet().size() and ForwardingMultiset.count(java.lang.Object) . |
protected boolean |
ForwardingMapEntry.standardEquals(Object object)
A sensible definition of
ForwardingMapEntry.equals(Object) in terms of ForwardingMapEntry.getKey() and ForwardingMapEntry.getValue() . |
protected boolean |
ForwardingSet.standardEquals(Object object)
A sensible definition of
ForwardingSet.equals(java.lang.Object) in terms of ForwardingCollection.size() and
ForwardingCollection.containsAll(java.util.Collection<?>) . |
protected boolean |
ForwardingList.standardEquals(Object object)
A sensible definition of
ForwardingList.equals(Object) in terms of ForwardingCollection.size()
and ForwardingCollection.iterator() . |
protected boolean |
ForwardingMap.standardEquals(Object object)
A sensible definition of
ForwardingMap.equals(java.lang.Object) in terms of the equals
method of ForwardingMap.entrySet() . |
protected int |
ForwardingMultiset.standardHashCode()
A sensible definition of
ForwardingMultiset.hashCode() as entrySet().hashCode()
. |
protected int |
ForwardingMapEntry.standardHashCode()
A sensible definition of
ForwardingMapEntry.hashCode() in terms of ForwardingMapEntry.getKey()
and ForwardingMapEntry.getValue() . |
protected int |
ForwardingSet.standardHashCode()
A sensible definition of
ForwardingSet.hashCode() in terms of ForwardingCollection.iterator() . |
protected int |
ForwardingList.standardHashCode()
A sensible definition of
ForwardingList.hashCode() in terms of ForwardingCollection.iterator() . |
protected int |
ForwardingMap.standardHashCode()
A sensible definition of
ForwardingMap.hashCode() in terms of the iterator
method of ForwardingMap.entrySet() . |
protected int |
ForwardingList.standardIndexOf(Object element)
A sensible default implementation of
ForwardingList.indexOf(java.lang.Object) , in terms of ForwardingList.listIterator() . |
protected boolean |
ForwardingCollection.standardIsEmpty()
A sensible definition of
ForwardingCollection.isEmpty() as !iterator().hasNext . |
protected boolean |
ForwardingMap.standardIsEmpty()
A sensible definition of
ForwardingMap.isEmpty() in terms of the iterator
method of ForwardingMap.entrySet() . |
protected Iterator<E> |
ForwardingMultiset.standardIterator()
A sensible definition of
ForwardingCollection.iterator() in terms of ForwardingMultiset.entrySet()
and ForwardingCollection.remove(Object) . |
protected Iterator<E> |
ForwardingList.standardIterator()
A sensible default implementation of
ForwardingCollection.iterator() , in terms of
ForwardingList.listIterator() . |
protected int |
ForwardingList.standardLastIndexOf(Object element)
A sensible default implementation of
ForwardingList.lastIndexOf(java.lang.Object) , in terms of
ForwardingList.listIterator(int) . |
protected ListIterator<E> |
ForwardingList.standardListIterator()
A sensible default implementation of
ForwardingList.listIterator() , in terms of
ForwardingList.listIterator(int) . |
protected ListIterator<E> |
ForwardingList.standardListIterator(int start)
A sensible default implementation of
ForwardingList.listIterator(int) , in terms
of ForwardingCollection.size() and ForwardingList.get(int) . |
protected boolean |
ForwardingQueue.standardOffer(E e)
A sensible definition of
ForwardingQueue.offer(E) in terms of ForwardingCollection.add(E) . |
protected E |
ForwardingQueue.standardPeek()
A sensible definition of
ForwardingQueue.peek() in terms of ForwardingQueue.element() . |
protected E |
ForwardingQueue.standardPoll()
A sensible definition of
ForwardingQueue.poll() in terms of ForwardingQueue.remove() . |
protected void |
ForwardingMap.standardPutAll(Map<? extends K,? extends V> map)
A sensible definition of
ForwardingMap.putAll(Map) in terms of ForwardingMap.put(Object, Object) . |
protected boolean |
ForwardingMultiset.standardRemove(Object element)
A sensible definition of
ForwardingCollection.remove(Object) in terms of ForwardingMultiset.remove(Object, int) . |
protected V |
ForwardingSortedMap.standardRemove(Object key)
A sensible definition of
ForwardingMap.remove(java.lang.Object) in terms of the iterator() of the entrySet() of ForwardingSortedMap.tailMap(K) . |
protected boolean |
ForwardingCollection.standardRemove(Object object)
A sensible definition of
ForwardingCollection.remove(java.lang.Object) in terms of ForwardingCollection.iterator() ,
using the iterator's remove method. |
protected boolean |
ForwardingSortedSet.standardRemove(Object object)
A sensible definition of
ForwardingCollection.remove(java.lang.Object) in terms of the iterator()
method of ForwardingSortedSet.tailSet(E) . |
protected V |
ForwardingMap.standardRemove(Object key)
A sensible, albeit inefficient, definition of
ForwardingMap.remove(java.lang.Object) in terms of
the iterator method of ForwardingMap.entrySet() . |
protected boolean |
ForwardingMultiset.standardRemoveAll(Collection<?> elementsToRemove)
A sensible definition of
ForwardingCollection.removeAll(java.util.Collection<?>) in terms of the removeAll method of ForwardingMultiset.elementSet() . |
protected boolean |
ForwardingCollection.standardRemoveAll(Collection<?> collection)
A sensible definition of
ForwardingCollection.removeAll(java.util.Collection<?>) in terms of ForwardingCollection.iterator() ,
using the iterator's remove method. |
protected boolean |
ForwardingMultiset.standardRetainAll(Collection<?> elementsToRetain)
A sensible definition of
ForwardingCollection.retainAll(java.util.Collection<?>) in terms of the retainAll method of ForwardingMultiset.elementSet() . |
protected boolean |
ForwardingCollection.standardRetainAll(Collection<?> collection)
A sensible definition of
ForwardingCollection.retainAll(java.util.Collection<?>) in terms of ForwardingCollection.iterator() ,
using the iterator's remove method. |
protected int |
ForwardingMultiset.standardSetCount(E element,
int count)
A sensible definition of
ForwardingMultiset.setCount(Object, int) in terms of ForwardingMultiset.count(Object) , ForwardingMultiset.add(Object, int) , and ForwardingMultiset.remove(Object,
int) . |
protected boolean |
ForwardingMultiset.standardSetCount(E element,
int oldCount,
int newCount)
A sensible definition of
ForwardingMultiset.setCount(Object, int, int) in terms of
ForwardingMultiset.count(Object) and ForwardingMultiset.setCount(Object, int) . |
protected int |
ForwardingMultiset.standardSize()
A sensible, albeit inefficient, definition of
ForwardingCollection.size() in terms of
ForwardingMultiset.entrySet() . |
protected List<E> |
ForwardingList.standardSubList(int fromIndex,
int toIndex)
A sensible default implementation of
ForwardingList.subList(int, int) . |
protected SortedMap<K,V> |
ForwardingSortedMap.standardSubMap(K fromKey,
K toKey)
A sensible default implementation of
ForwardingSortedMap.subMap(Object, Object) in
terms of ForwardingSortedMap.headMap(Object) and ForwardingSortedMap.tailMap(Object) . |
protected SortedSet<E> |
ForwardingSortedSet.standardSubSet(E fromElement,
E toElement)
A sensible default implementation of
ForwardingSortedSet.subSet(Object, Object) in
terms of ForwardingSortedSet.headSet(Object) and ForwardingSortedSet.tailSet(Object) . |
protected Object[] |
ForwardingCollection.standardToArray()
A sensible definition of
ForwardingCollection.toArray() in terms of ForwardingCollection.toArray(Object[]) . |
protected <T> T[] |
ForwardingCollection.standardToArray(T[] array)
A sensible definition of
ForwardingCollection.toArray(Object[]) in terms of ForwardingCollection.size() and ForwardingCollection.iterator() . |
protected String |
ForwardingMultiset.standardToString()
A sensible definition of
ForwardingObject.toString() as entrySet().toString()
. |
protected String |
ForwardingMapEntry.standardToString()
A sensible definition of
ForwardingObject.toString() in terms of ForwardingMapEntry.getKey() and ForwardingMapEntry.getValue() . |
protected String |
ForwardingCollection.standardToString()
A sensible definition of
ForwardingObject.toString() in terms of ForwardingCollection.iterator() . |
protected String |
ForwardingMap.standardToString()
A sensible definition of
ForwardingObject.toString() in terms of the iterator
method of ForwardingMap.entrySet() . |
static <K,V1,V2> ListMultimap<K,V2> |
Multimaps.transformEntries(ListMultimap<K,V1> fromMap,
Maps.EntryTransformer<? super K,? super V1,V2> transformer)
Returns a view of a
ListMultimap whose values are derived from the
original multimap's entries. |
static <K,V1,V2> Multimap<K,V2> |
Multimaps.transformEntries(Multimap<K,V1> fromMap,
Maps.EntryTransformer<? super K,? super V1,V2> transformer)
Returns a view of a multimap whose values are derived from the original
multimap's entries.
|
static <K,V1,V2> SortedMap<K,V2> |
Maps.transformEntries(SortedMap<K,V1> fromMap,
Maps.EntryTransformer<? super K,? super V1,V2> transformer)
Returns a view of a sorted map whose values are derived from the original
sorted map's entries.
|
static <K,V1,V2> ListMultimap<K,V2> |
Multimaps.transformValues(ListMultimap<K,V1> fromMultimap,
Function<? super V1,V2> function)
Returns a view of a
ListMultimap where each value is transformed by
a function. |
static <K,V1,V2> Multimap<K,V2> |
Multimaps.transformValues(Multimap<K,V1> fromMultimap,
Function<? super V1,V2> function)
Returns a view of a multimap where each value is transformed by a function.
|
static <K,V1,V2> SortedMap<K,V2> |
Maps.transformValues(SortedMap<K,V1> fromMap,
Function<? super V1,V2> function)
Returns a view of a sorted map where each value is transformed by a
function.
|
static <K,V,I extends Object & Iterable<V> & Iterator<V>> |
Maps.uniqueIndex(I values,
Function<? super V,K> keyFunction)
Deprecated.
use
Maps.uniqueIndex(Iterator, Function) by casting values to Iterator<V> , or better yet, by implementing only
Iterator and not Iterable . This method is scheduled
for deletion in March 2012. |
static <E> SortedMultiset<E> |
Multisets.unmodifiableSortedMultiset(SortedMultiset<E> sortedMultiset)
Returns an unmodifiable view of the specified sorted multiset.
|
Modifier and Type | Class and Description |
---|---|
interface |
AllowConcurrentEvents
Marks an event handling method as being thread-safe.
|
class |
AsyncEventBus
An
EventBus that takes the Executor of your choice and uses it to
dispatch events, allowing dispatch to occur asynchronously. |
class |
DeadEvent
Wraps an event that was posted, but which had no subscribers and thus could
not be delivered.
|
class |
EventBus
Dispatches events to listeners, and provides ways for listeners to register
themselves.
|
interface |
Subscribe
Marks a method as an event handler, as used by
AnnotatedHandlerFinder and EventBus . |
Modifier and Type | Class and Description |
---|---|
class |
BloomFilter<T>
A Bloom filter for instances of
T . |
interface |
Funnel<T>
An object which can send data from an object of type
T into a Sink . |
class |
Funnels
Funnels for common types.
|
class |
HashCode
An immutable hash code of arbitrary bit length.
|
interface |
Hasher
A
Sink that can compute a hash code after reading the input. |
interface |
HashFunction
A hash function is a collision-averse pure function that maps an arbitrary block of
data to a number called a hash code.
|
class |
Hashing
Static methods to obtain
HashFunction instances, and other static
hashing-related utilities. |
interface |
Sink
An object which can receive a stream of primitive values.
|
Modifier and Type | Interface and Description |
---|---|
interface |
ByteProcessor<T>
A callback interface to process bytes from a stream.
|
class |
ByteStreams
Provides utility methods for working with byte arrays and I/O streams.
|
class |
CharStreams
Provides utility methods for working with character streams.
|
class |
Closeables
Utility methods for working with
Closeable objects. |
class |
CountingInputStream
An
InputStream that counts the number of bytes read. |
class |
CountingOutputStream
An OutputStream that counts the number of bytes written.
|
class |
FileBackedOutputStream
An
OutputStream that starts buffering to a byte array, but
switches to file buffering once the data reaches a configurable size. |
class |
Files
Provides utility methods for working with files.
|
class |
Flushables
Utility methods for working with
Flushable objects. |
class |
LimitInputStream
An InputStream that limits the number of bytes which can be read.
|
interface |
LineProcessor<T>
A callback to be used with the streaming
readLines methods. |
class |
LineReader
A class for reading lines of text.
|
class |
LittleEndianDataInputStream
An implementation of
DataInput that uses little-endian byte ordering
for reading short , int , float , double , and
long values. |
class |
LittleEndianDataOutputStream
An implementation of
DataOutput that uses little-endian byte ordering
for writing char , short , int , float , double , and long values. |
class |
NullOutputStream
Implementation of
OutputStream that simply discards written bytes. |
class |
PatternFilenameFilter
File name filter that only accepts files matching a regular expression.
|
class |
Resources
Provides utility methods for working with resources in the classpath.
|
Modifier and Type | Class and Description |
---|---|
class |
BigIntegerMath
A class for arithmetic on values of type
BigInteger . |
class |
DoubleMath
A class for arithmetic on doubles that is not covered by
Math . |
class |
IntMath
A class for arithmetic on values of type
int . |
class |
LongMath
A class for arithmetic on values of type
long . |
Modifier and Type | Class and Description |
---|---|
class |
HostAndPort
An immutable representation of a host and port.
|
class |
HostSpecifier
A syntactically valid host specifier, suitable for use in a URI.
|
class |
HttpHeaders
Contains constant definitions for the HTTP header field names.
|
class |
InetAddresses
Static utility methods pertaining to
InetAddress instances. |
static class |
InetAddresses.TeredoInfo
A simple data class to encapsulate the information to be found in a
Teredo address.
|
class |
InternetDomainName
An immutable well-formed internet domain name, such as
com or foo.co.uk . |
Modifier and Type | Class and Description |
---|---|
class |
UnsignedInteger
A wrapper class for unsigned
int values, supporting arithmetic operations. |
class |
UnsignedInts
Static utility methods pertaining to
int primitives that interpret values as
unsigned (that is, any negative value x is treated as the positive value
2^32 + x ). |
class |
UnsignedLong
A wrapper class for unsigned
long values, supporting arithmetic operations. |
class |
UnsignedLongs
Static utility methods pertaining to
long primitives that interpret values as
unsigned (that is, any negative value x is treated as the positive value
2^64 + x ). |
Modifier and Type | Method and Description |
---|---|
static Integer |
Ints.tryParse(String string)
Parses the specified string as a signed decimal integer value.
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractCheckedFuture<V,X extends Exception>
A delegating wrapper around a
ListenableFuture that adds support for
the AbstractCheckedFuture.checkedGet() and AbstractCheckedFuture.checkedGet(long, TimeUnit) methods. |
class |
AbstractExecutionThreadService
Base class for services that can implement
AbstractExecutionThreadService.startUp() , AbstractExecutionThreadService.run() and
AbstractExecutionThreadService.shutDown() methods. |
class |
AbstractIdleService
Base class for services that do not need a thread while "running"
but may need one during startup and shutdown.
|
class |
AbstractScheduledService
Base class for services that can implement
AbstractScheduledService.startUp() and AbstractScheduledService.shutDown() but while in
the "running" state need to perform a periodic task. |
static class |
AbstractScheduledService.CustomScheduler
A
AbstractScheduledService.Scheduler that provides a convenient way for the AbstractScheduledService to
use a dynamically changing schedule. |
protected static class |
AbstractScheduledService.CustomScheduler.Schedule
A value object that represents an absolute delay until a task should be invoked.
|
class |
AbstractService
Base class for implementing services that can handle
AbstractService.doStart() and
AbstractService.doStop() requests, responding to them with AbstractService.notifyStarted()
and AbstractService.notifyStopped() callbacks. |
interface |
AsyncFunction<I,O>
Transforms a value, possibly asynchronously.
|
class |
AtomicDouble
A
double value that may be updated atomically. |
class |
AtomicDoubleArray
A
double array in which elements may be updated atomically. |
class |
AtomicLongMap<K>
A map containing
long values that can be atomically updated. |
class |
Atomics
Static utility methods pertaining to classes in the
java.util.concurrent.atomic package. |
interface |
CheckedFuture<V,X extends Exception>
A
CheckedFuture is a ListenableFuture that includes versions
of the get methods that can throw a checked exception. |
class |
ExecutionError
Error variant of ExecutionException . |
class |
FakeTimeLimiter
A TimeLimiter implementation which actually does not attempt to limit time
at all.
|
class |
ForwardingCheckedFuture<V,X extends Exception>
A future which forwards all its method calls to another future.
|
static class |
ForwardingCheckedFuture.SimpleForwardingCheckedFuture<V,X extends Exception>
A simplified version of
ForwardingCheckedFuture where subclasses
can pass in an already constructed CheckedFuture as the delegate. |
class |
ForwardingService
A
Service that forwards all method calls to another service. |
interface |
FutureCallback<V>
A callback for accepting the results of a
Future
computation asynchronously. |
class |
Futures
Static utility methods pertaining to the
Future interface. |
class |
JdkFutureAdapters
Utilities necessary for working with libraries that supply plain
Future instances. |
interface |
ListeningScheduledExecutorService
A
ScheduledExecutorService that returns ListenableFuture
instances from its ExecutorService methods. |
class |
Monitor
A synchronization abstraction supporting waiting on arbitrary boolean conditions.
|
static class |
Monitor.Guard
A boolean condition for which a thread may wait.
|
interface |
Service
An object with an operational state, plus asynchronous
Service.start() and
Service.stop() lifecycle methods to transfer into and out of this state. |
static class |
Service.State
The lifecycle states of a service.
|
class |
SimpleTimeLimiter
A TimeLimiter that runs method calls in the background using an
ExecutorService . |
interface |
TimeLimiter
Produces proxies that impose a time limit on method
calls to the proxied object.
|
class |
UncheckedExecutionException
Unchecked variant of
ExecutionException . |
class |
Uninterruptibles
Utilities for treating interruptible operations as uninterruptible.
|
Modifier and Type | Method and Description |
---|---|
static void |
MoreExecutors.addDelayedShutdownHook(ExecutorService service,
long terminationTimeout,
TimeUnit timeUnit)
Add a shutdown hook to wait for thread completion in the given
service . |
static <V> ListenableFuture<List<V>> |
Futures.allAsList(Iterable<? extends ListenableFuture<? extends V>> futures)
Creates a new
ListenableFuture whose value is a list containing the
values of all its input futures, if all succeed. |
static <V> ListenableFuture<List<V>> |
Futures.allAsList(ListenableFuture<? extends V>... futures)
Creates a new
ListenableFuture whose value is a list containing the
values of all its input futures, if all succeed. |
static <V,X extends Exception> |
Futures.get(Future<V> future,
Class<X> exceptionClass)
Returns the result of
Future.get() , converting most exceptions to a
new instance of the given checked exception type. |
static <V,X extends Exception> |
Futures.get(Future<V> future,
long timeout,
TimeUnit unit,
Class<X> exceptionClass)
Returns the result of
Future.get(long, TimeUnit) , converting most
exceptions to a new instance of the given checked exception type. |
static ExecutorService |
MoreExecutors.getExitingExecutorService(ThreadPoolExecutor executor)
Converts the given ThreadPoolExecutor into an ExecutorService that exits
when the application is complete.
|
static ExecutorService |
MoreExecutors.getExitingExecutorService(ThreadPoolExecutor executor,
long terminationTimeout,
TimeUnit timeUnit)
Converts the given ThreadPoolExecutor into an ExecutorService that exits
when the application is complete.
|
static ScheduledExecutorService |
MoreExecutors.getExitingScheduledExecutorService(ScheduledThreadPoolExecutor executor)
Converts the given ThreadPoolExecutor into a ScheduledExecutorService that
exits when the application is complete.
|
static ScheduledExecutorService |
MoreExecutors.getExitingScheduledExecutorService(ScheduledThreadPoolExecutor executor,
long terminationTimeout,
TimeUnit timeUnit)
Converts the given ScheduledThreadPoolExecutor into a
ScheduledExecutorService that exits when the application is complete.
|
static <V> V |
Futures.getUnchecked(Future<V> future)
Returns the result of calling
Future.get() uninterruptibly on a
task known not to throw a checked exception. |
static <I,O> Future<O> |
Futures.lazyTransform(Future<I> future,
Function<? super I,? extends O> function)
Like
Futures.transform(ListenableFuture, Function) except that the
transformation function is invoked on each call to
get() on the returned future. |
static <V> ListenableFuture<List<V>> |
Futures.successfulAsList(Iterable<? extends ListenableFuture<? extends V>> futures)
Creates a new
ListenableFuture whose value is a list containing the
values of all its successful input futures. |
static <V> ListenableFuture<List<V>> |
Futures.successfulAsList(ListenableFuture<? extends V>... futures)
Creates a new
ListenableFuture whose value is a list containing the
values of all its successful input futures. |
Copyright © 2010-2012. All Rights Reserved.