Package | Description |
---|---|
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.escape |
Interfaces, utilities, and simple implementations of escapers and encoders.
|
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.html |
Escapers
for
HTML.
|
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.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 ,
and value types for treating them as unsigned. |
com.google.common.reflect |
This package contains utilities to work with Java reflection.
|
com.google.common.util.concurrent |
Concurrency utilities.
|
com.google.common.xml |
Modifier and Type | Class and Description |
---|---|
class |
CharMatcher
|
class |
Enums
Utility methods for working with
Enum instances. |
static class |
Splitter.MapSplitter
An object that splits strings into maps as
Splitter splits
iterables and lists. |
class |
StandardSystemProperty
Represents a standard system property.
|
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 | Method and Description |
---|---|
<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.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 . |
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.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. |
Predicate<T> |
Equivalence.equivalentTo(T target)
Returns a predicate that evaluates to true if and only if the input is
equivalent to
target according to this equivalence relation. |
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. |
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.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. |
abstract T |
Optional.or(Supplier<? extends T> supplier)
Returns the contained instance if it is present;
supplier.get() otherwise. |
static <T> Iterable<T> |
Optional.presentInstances(Iterable<? extends Optional<? extends T>> optionals)
Returns the value of each present instance from the supplied
optionals , in order,
skipping over occurrences of Optional.absent() . |
List<String> |
Splitter.splitToList(CharSequence sequence)
Splits
sequence into string components and returns them as
an immutable list. |
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(char separator)
Returns a
MapSplitter which splits entries based on this splitter,
and splits entries into keys and values using the specified separator. |
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 |
CacheBuilderSpec
A specification of a
CacheBuilder configuration. |
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 | Method and Description |
---|---|
static CacheBuilder<Object,Object> |
CacheBuilder.from(CacheBuilderSpec spec)
Constructs a new
CacheBuilder instance with the settings specified in spec . |
static <K,V> CacheLoader<K,V> |
CacheLoader.from(Function<K,V> function)
Returns a cache loader based on an existing function instance.
|
static CacheBuilder<Object,Object> |
CacheBuilder.from(String spec)
Constructs a new
CacheBuilder instance with the settings specified in spec . |
static <V> CacheLoader<Object,V> |
CacheLoader.from(Supplier<V> supplier)
Returns a cache loader based on an existing supplier instance.
|
CacheBuilder<K,V> |
CacheBuilder.refreshAfterWrite(long duration,
TimeUnit unit)
Specifies that active entries are eligible for automatic refresh once a fixed duration has
elapsed after the entry's creation, or the most recent replacement of its value.
|
Modifier and Type | Class and Description |
---|---|
class |
ArrayTable<R,C,V>
Fixed-size
Table implementation backed by a two-dimensional array. |
class |
BinaryTreeTraverser<T>
A variant of
TreeTraverser for binary trees, providing additional traversals specific to
binary trees. |
interface |
Constraint<E>
Deprecated.
Use
Preconditions for basic checks. In place of
constrained collections, we encourage you to check your preconditions
explicitly instead of leaving that work to the collection implementation.
For the specific case of rejecting null, consider the immutable
collections.
This interface is scheduled for removal in Guava 16.0. |
class |
Constraints
Deprecated.
Use
Preconditions for basic checks. In place of
constrained collections, we encourage you to check your preconditions
explicitly instead of leaving that work to the collection implementation.
For the specific case of rejecting null, consider the immutable
collections.
This class is scheduled for removal in Guava 16.0. |
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 instances. |
class |
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.
|
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) . |
protected class |
ForwardingNavigableMap.StandardDescendingMap
A sensible implementation of
NavigableMap.descendingMap() in terms of the methods of
this NavigableMap . |
protected class |
ForwardingNavigableMap.StandardNavigableKeySet
A sensible implementation of
NavigableMap.navigableKeySet() in terms of the methods of
this NavigableMap . |
protected class |
ForwardingNavigableSet.StandardDescendingSet
A sensible implementation of
NavigableSet.descendingSet() in terms of the other methods
of NavigableSet , notably including NavigableSet.descendingIterator() . |
protected class |
ForwardingSortedMap.StandardKeySet
A sensible implementation of
SortedMap.keySet() in terms of the methods of
ForwardingSortedMap . |
class |
ForwardingSortedMultiset<E>
A sorted multiset which forwards all its method calls to another sorted multiset.
|
class |
GenericMapMaker<K0,V0>
Deprecated.
This class existed only to support the generic paramterization necessary for the
caching functionality in
MapMaker . That functionality has been moved to CacheBuilder , which is a properly generified class and thus needs no
"Generic" equivalent; simple use CacheBuilder naturally. For general migration
instructions, see the MapMaker Migration
Guide. This class is scheduled for removal in Guava 16.0. |
class |
ImmutableRangeMap<K extends Comparable<?>,V>
An immutable implementation of
RangeMap , supporting all query operations efficiently. |
class |
ImmutableRangeSet<C extends Comparable>
An efficient immutable implementation of a
RangeSet . |
class |
ImmutableSortedMultiset<E>
An immutable
SortedMultiset that stores its elements in a sorted array. |
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.
|
interface |
RangeMap<K extends Comparable,V>
A mapping from disjoint nonempty ranges to non-null values.
|
interface |
RangeSet<C extends Comparable>
|
interface |
RowSortedTable<R,C,V>
Interface that extends
Table and whose rows are sorted. |
interface |
SortedMultiset<E>
A
Multiset which maintains the ordering of its elements, according to
either their natural order or an explicit Comparator . |
class |
TreeBasedTable<R,C,V>
Implementation of
Table whose row keys and column keys are ordered
by their natural ordering or by supplied comparators. |
class |
TreeRangeMap<K extends Comparable,V>
An implementation of
RangeMap based on a TreeMap , supporting
all optional operations. |
class |
TreeRangeSet<C extends Comparable<?>>
|
class |
TreeTraverser<T>
Views elements of a type
T as nodes in a tree, and provides methods to traverse the trees
induced by this traverser. |
Modifier and Type | Method and Description |
---|---|
static <K,V> Map<K,List<V>> |
Multimaps.asMap(ListMultimap<K,V> multimap)
|
static <K,V> Map<K,Collection<V>> |
Multimaps.asMap(Multimap<K,V> multimap)
Returns
multimap.asMap() . |
static <K,V> NavigableMap<K,V> |
Maps.asMap(NavigableSet<K> set,
Function<? super K,V> function)
Returns a view of the navigable set as a map, mapping keys from the set
according to the specified function.
|
static <K,V> Map<K,V> |
Maps.asMap(Set<K> set,
Function<? super K,V> function)
Returns a live
Map view whose keys are the contents of set
and whose values are computed on demand using function . |
static <K,V> Map<K,Set<V>> |
Multimaps.asMap(SetMultimap<K,V> multimap)
|
static <K,V> SortedMap<K,V> |
Maps.asMap(SortedSet<K> set,
Function<? super K,V> function)
Returns a view of the sorted set as a map, mapping keys from the set
according to the specified function.
|
static <K,V> Map<K,SortedSet<V>> |
Multimaps.asMap(SortedSetMultimap<K,V> multimap)
Returns
multimap.asMap() , with its type
corrected from Map<K, Collection<V>> to
Map<K, SortedSet<V>> . |
ImmutableSetMultimap<K,V> |
ImmutableMap.asMultimap()
Returns a multimap view of the map.
|
ContiguousSet<C> |
Range.asSet(DiscreteDomain<C> domain)
Deprecated.
Use
ContiguousSet.create(range, domain) . To be removed in Guava 16.0. |
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 <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(MapMaker 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 <E> Multiset<E> |
Multisets.difference(Multiset<E> multiset1,
Multiset<?> multiset2)
Returns an unmodifiable view of the difference of two multisets.
|
static <E> int |
Queues.drain(BlockingQueue<E> q,
Collection<? super E> buffer,
int numElements,
long timeout,
TimeUnit unit)
Drains the queue as
BlockingQueue.drainTo(Collection, int) , but if the requested
numElements elements are not available, it will wait for them up to the specified
timeout. |
static <E> int |
Queues.drainUninterruptibly(BlockingQueue<E> q,
Collection<? super E> buffer,
int numElements,
long timeout,
TimeUnit unit)
Drains the queue as Queues.drain(BlockingQueue, Collection, int, long, TimeUnit),
but with a different behavior in case it is interrupted while waiting.
|
static <E> Multiset<E> |
Multisets.filter(Multiset<E> unfiltered,
Predicate<? super E> predicate)
Returns a view of the elements of
unfiltered that satisfy a predicate. |
static <K extends Enum<K>,V> |
Maps.immutableEnumMap(Map<K,? extends V> map)
Returns an immutable map instance containing the given entries.
|
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. |
static <R,C,V> Table<R,C,V> |
Tables.newCustomTable(Map<R,Map<C,V>> backingMap,
Supplier<? extends Map<C,V>> factory)
Creates a table that uses the specified backing map and factory.
|
static <E extends Comparable<? super E>> |
Collections2.orderedPermutations(Iterable<E> elements)
Returns a
Collection of all the permutations of the specified
Iterable . |
static <E> Collection<List<E>> |
Collections2.orderedPermutations(Iterable<E> elements,
Comparator<? super E> comparator)
Returns a
Collection of all the permutations of the specified
Iterable using the specified Comparator for establishing
the lexicographical ordering. |
static <E> Collection<List<E>> |
Collections2.permutations(Collection<E> elements)
Returns a
Collection of all the permutations of the specified
Collection . |
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 |
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 |
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 |
ForwardingSortedMap.standardContainsKey(Object key)
A sensible definition of
ForwardingMap.containsKey(java.lang.Object) in terms of the firstKey() method of ForwardingSortedMap.tailMap(K) . |
protected int |
ForwardingMultiset.standardCount(Object object)
A sensible, albeit inefficient, definition of
ForwardingMultiset.count(java.lang.Object) in terms of
ForwardingMultiset.entrySet() . |
protected NavigableSet<K> |
ForwardingNavigableMap.standardDescendingKeySet()
A sensible definition of
ForwardingNavigableMap.descendingKeySet() as the navigableKeySet of
ForwardingNavigableMap.descendingMap() . |
protected boolean |
ForwardingList.standardEquals(Object object)
A sensible definition of
ForwardingList.equals(Object) in terms of ForwardingCollection.size()
and ForwardingCollection.iterator() . |
protected int |
ForwardingList.standardHashCode()
A sensible definition of
ForwardingList.hashCode() in terms of ForwardingCollection.iterator() . |
protected ListIterator<E> |
ForwardingList.standardListIterator(int start)
A sensible default implementation of
ForwardingList.listIterator(int) , in terms
of ForwardingCollection.size() , ForwardingList.get(int) , ForwardingList.set(int, Object) , ForwardingList.add(int, Object) , and ForwardingList.remove(int) . |
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 V |
ForwardingSortedMap.standardRemove(Object key)
Deprecated.
This implementation is extremely awkward, is rarely worthwhile,
and has been discovered to interact badly with
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6467933 in Java 6
when used with certain null-friendly comparators. It is scheduled for
deletion in Guava 16.0.
|
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 NavigableSet<E> |
ForwardingNavigableSet.standardSubSet(E fromElement,
boolean fromInclusive,
E toElement,
boolean toInclusive)
A sensible definition of
ForwardingNavigableSet.subSet(Object, boolean, Object, boolean) in terms of the
headSet and tailSet methods. |
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 String |
ForwardingMapEntry.standardToString()
A sensible definition of
ForwardingObject.toString() in terms of ForwardingMapEntry.getKey() and ForwardingMapEntry.getValue() . |
static <E> Multiset<E> |
Multisets.sum(Multiset<? extends E> multiset1,
Multiset<? extends E> multiset2)
Returns an unmodifiable view of the sum of two multisets.
|
static <E> Deque<E> |
Queues.synchronizedDeque(Deque<E> deque)
Returns a synchronized (thread-safe) deque backed by the specified deque.
|
static <E> Queue<E> |
Queues.synchronizedQueue(Queue<E> queue)
Returns a synchronized (thread-safe) queue backed by the specified queue.
|
static <K,V> ImmutableMap<K,V> |
Maps.toMap(Iterable<K> keys,
Function<? super K,V> valueFunction)
Returns an immutable map whose keys are the distinct elements of
keys and whose value for each key was computed by valueFunction . |
static <K,V> ImmutableMap<K,V> |
Maps.toMap(Iterator<K> keys,
Function<? super K,V> valueFunction)
Returns an immutable map whose keys are the distinct elements of
keys and whose value for each key was computed by valueFunction . |
ImmutableList<E> |
FluentIterable.toSortedList(Comparator<? super E> comparator)
Returns an
ImmutableList containing all of the elements from this FluentIterable in the order specified by comparator . |
static <R,C,V1,V2> |
Tables.transformValues(Table<R,C,V1> fromTable,
Function<? super V1,V2> function)
Returns a view of a table where each value is transformed by a function.
|
static <E> Multiset<E> |
Multisets.union(Multiset<? extends E> multiset1,
Multiset<? extends E> multiset2)
Returns an unmodifiable view of the union of two multisets.
|
static <R,C,V> RowSortedTable<R,C,V> |
Tables.unmodifiableRowSortedTable(RowSortedTable<R,? extends C,? extends V> table)
Returns an unmodifiable view of the specified row-sorted table.
|
static <E> SortedMultiset<E> |
Multisets.unmodifiableSortedMultiset(SortedMultiset<E> sortedMultiset)
Returns an unmodifiable view of the specified sorted multiset.
|
Modifier and Type | Class and Description |
---|---|
class |
ArrayBasedCharEscaper
A
CharEscaper that uses an array to quickly look up replacement
characters for a given char value. |
class |
ArrayBasedEscaperMap
An implementation-specific parameter class suitable for initializing
ArrayBasedCharEscaper or ArrayBasedUnicodeEscaper instances. |
class |
ArrayBasedUnicodeEscaper
A
UnicodeEscaper that uses an array to quickly look up replacement
characters for a given code point. |
class |
CharEscaper
An object that converts literal text into a format safe for inclusion in a particular context
(such as an XML document).
|
class |
CharEscaperBuilder
Simple helper class to build a "sparse" array of objects based on the indexes that were added to
it.
|
class |
Escaper
An object that converts literal text into a format safe for inclusion in a particular context
(such as an XML document).
|
class |
Escapers
Static utility methods pertaining to
Escaper instances. |
static class |
Escapers.Builder
A builder for simple, fast escapers.
|
class |
UnicodeEscaper
An
Escaper that converts literal text into a format safe for
inclusion in a particular context (such as an XML document). |
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 PrimitiveSink . |
class |
Funnels
Funnels for common types.
|
class |
HashCode
An immutable hash code of arbitrary bit length.
|
class |
HashCodes
Deprecated.
Use the duplicated methods in
HashCode instead. This class is scheduled
to be removed in Guava 16.0. |
interface |
Hasher
A
PrimitiveSink 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 |
PrimitiveSink
An object which can receive a stream of primitive values.
|
Modifier and Type | Class and Description |
---|---|
class |
HtmlEscapers
Escaper instances suitable for strings to be included in HTML
attribute values and most elements' text contents. |
Modifier and Type | Class and Description |
---|---|
class |
BaseEncoding
A binary encoding scheme for reversibly translating between byte sequences and printable ASCII
strings.
|
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 |
Closer
|
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. |
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 |
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 |
HostAndPort
An immutable representation of a host and port.
|
class |
HostSpecifier
A syntactically valid host specifier, suitable for use in a URI.
|
class |
InetAddresses
Static utility methods pertaining to
InetAddress instances. |
static class |
InetAddresses.TeredoInfo
A simple immutable 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 . |
class |
MediaType
Represents an Internet Media Type
(also known as a MIME Type or Content Type).
|
class |
PercentEscaper
A
UnicodeEscaper that escapes some set of Java characters using a
UTF-8 based percent encoding scheme. |
class |
UrlEscapers
Escaper instances suitable for strings to be included in particular
sections of URLs. |
Modifier and Type | Field and Description |
---|---|
static String |
HttpHeaders.PUBLIC_KEY_PINS
The HTTP
Public-Key-Pins header field name. |
static String |
HttpHeaders.PUBLIC_KEY_PINS_REPORT_ONLY
The HTTP
Public-Key-Pins-Report-Only header field name. |
Modifier and Type | Class and Description |
---|---|
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 |
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 byte |
UnsignedBytes.parseUnsignedByte(String string)
Returns the unsigned
byte value represented by the given decimal string. |
static byte |
UnsignedBytes.parseUnsignedByte(String string,
int radix)
Returns the unsigned
byte value represented by a string with the given radix. |
static String |
UnsignedBytes.toString(byte x)
Returns a string representation of x, where x is treated as unsigned.
|
static String |
UnsignedBytes.toString(byte x,
int radix)
Returns a string representation of
x for the given radix, where x is treated
as unsigned. |
static Double |
Doubles.tryParse(String string)
Parses the specified string as a double-precision floating point value.
|
static Float |
Floats.tryParse(String string)
Parses the specified string as a single-precision floating point value.
|
static Long |
Longs.tryParse(String string)
Parses the specified string as a signed decimal long value.
|
static Integer |
Ints.tryParse(String string)
Parses the specified string as a signed decimal integer value.
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractInvocationHandler
Abstract implementation of
InvocationHandler that handles Object.equals(java.lang.Object) ,
Object.hashCode() and Object.toString() . |
class |
ClassPath
Scans the source of a
ClassLoader and finds all loadable classes and resources. |
static class |
ClassPath.ClassInfo
Represents a class that can be loaded through
ClassPath.ClassInfo.load() . |
static class |
ClassPath.ResourceInfo
Represents a class path resource that can be either a class file or any other resource file
loadable from the class path.
|
class |
ImmutableTypeToInstanceMap<B>
A type-to-instance map backed by an
ImmutableMap . |
static class |
ImmutableTypeToInstanceMap.Builder<B>
A builder for creating immutable type-to-instance maps.
|
class |
Invokable<T,R>
Wrapper around either a
Method or a Constructor . |
class |
MutableTypeToInstanceMap<B>
A mutable type-to-instance map.
|
class |
Parameter
Represents a method or constructor parameter.
|
class |
Reflection
Static utilities relating to Java reflection.
|
class |
TypeParameter<T>
Captures a free type variable that can be used in
TypeToken.where(com.google.common.reflect.TypeParameter<X>, com.google.common.reflect.TypeToken<X>) . |
class |
TypeResolver
An object of this class encapsulates type mappings from type variables.
|
interface |
TypeToInstanceMap<B>
A map, each entry of which maps a
TypeToken to an instance of that type. |
class |
TypeToken<T>
A
Type with generics. |
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 |
AbstractListeningExecutorService
Abstract
ListeningExecutorService implementation that creates
ListenableFutureTask instances for each Runnable and Callable submitted
to it. |
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 |
CheckedFuture<V,X extends Exception>
A
CheckedFuture is a ListenableFuture that includes versions
of the get methods that can throw a checked exception. |
class |
CycleDetectingLockFactory
The
CycleDetectingLockFactory creates ReentrantLock instances and
ReentrantReadWriteLock instances that detect potential deadlock by checking
for cycles in lock acquisition order. |
static class |
CycleDetectingLockFactory.Policies
Pre-defined
CycleDetectingLockFactory.Policy implementations. |
static interface |
CycleDetectingLockFactory.Policy
Encapsulates the action to be taken when a potential deadlock is
encountered.
|
static class |
CycleDetectingLockFactory.PotentialDeadlockException
Represents a detected cycle in lock acquisition ordering.
|
static class |
CycleDetectingLockFactory.WithExplicitOrdering<E extends Enum<E>>
A
CycleDetectingLockFactory.WithExplicitOrdering provides the
additional enforcement of an application-specified ordering of lock
acquisitions. |
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
Deprecated.
Instead of using a
ForwardingService , consider using the
Service.Listener functionality to hook into the Service
lifecycle, or if you really do need to provide access to some Service
methods, consider just providing the few that you actually need (e.g. just
ForwardingService.startAndWait() ) and not implementing Service. |
interface |
FutureFallback<V>
Provides a backup
Future to replace an earlier failed Future . |
class |
Futures
Static utility methods pertaining to the
Future interface. |
class |
JdkFutureAdapters
Utilities necessary for working with libraries that supply plain
Future instances. |
interface |
ListenableScheduledFuture<V>
Helper interface to implement both
ListenableFuture and
ScheduledFuture . |
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.
|
class |
RateLimiter
A rate limiter.
|
interface |
Service
An object with an operational state, plus asynchronous
Service.startAsync() and
Service.stopAsync() lifecycle methods to transition between states. |
static class |
Service.Listener
A listener for the various state changes that a
Service goes through in its lifecycle. |
static class |
Service.State
The lifecycle states of a service.
|
class |
ServiceManager
A manager for monitoring and controlling a set of
services . |
static class |
ServiceManager.Listener
A listener for the aggregate state changes of the services that are under management.
|
class |
SimpleTimeLimiter
A TimeLimiter that runs method calls in the background using an
ExecutorService . |
class |
Striped<L>
A striped
Lock/Semaphore/ReadWriteLock . |
interface |
TimeLimiter
Produces proxies that impose a time limit on method
calls to the proxied object.
|
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 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 ThreadFactory |
MoreExecutors.platformThreadFactory()
Returns a default thread factory used to create new threads.
|
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. |
Modifier and Type | Class and Description |
---|---|
class |
XmlEscapers
Escaper instances suitable for strings to be included in XML
attribute values and elements' text contents. |
Copyright © 2010-2013. All Rights Reserved.