| 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.collect.testing | |
| com.google.common.collect.testing.features | |
| com.google.common.collect.testing.google | |
| com.google.common.collect.testing.testers | |
| 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, and value types for
treating them as unsigned. |
| com.google.common.testing |
This package contains testing utilities.
|
| com.google.common.util.concurrent |
Concurrency utilities.
|
| com.google.common.util.concurrent.testing |
| Modifier and Type | Class and Description |
|---|---|
private static class |
CharMatcher.BitSetMatcher
Fast matcher using a
BitSet table of matching characters. |
class |
Defaults
This class provides default values for all Java types, as defined by the JLS.
|
class |
FinalizablePhantomReference<T>
Phantom reference with a
finalizeReferent() method which a background thread invokes
after the garbage collector reclaims the referent. |
interface |
FinalizableReference
Implemented by references that have code to run after garbage collection of their referents.
|
class |
FinalizableReferenceQueue
A reference queue with an associated background thread that dequeues references and invokes
FinalizableReference.finalizeReferent() on them. |
class |
FinalizableSoftReference<T>
Soft reference with a
finalizeReferent() method which a background thread invokes after
the garbage collector reclaims the referent. |
class |
FinalizableWeakReference<T>
Weak reference with a
finalizeReferent() method which a background thread invokes after
the garbage collector reclaims the referent. |
(package private) class |
JdkPattern
A regex pattern implementation which is backed by the
Pattern. |
(package private) interface |
PatternCompiler
Pluggable interface for compiling a regex pattern.
|
private static class |
Predicates.ContainsPatternFromStringPredicate |
private static class |
Predicates.ContainsPatternPredicate |
private static class |
Predicates.InstanceOfPredicate |
private static class |
Predicates.SubtypeOfPredicate |
(package private) class |
SmallCharMatcher
An immutable version of CharMatcher for smallish sets of characters that uses a hash table with
linear probing to check for matches.
|
class |
StandardSystemProperty
Represents a standard system property.
|
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Map<java.lang.Class<? extends java.lang.Enum<?>>,java.util.Map<java.lang.String,java.lang.ref.WeakReference<? extends java.lang.Enum<?>>>> |
Enums.enumConstantCache |
private static java.lang.reflect.Method |
Throwables.getStackTraceDepthMethod
The "getStackTraceDepth" method, only available on some JDKs so we use reflection to find it
when available.
|
private static java.lang.reflect.Method |
Throwables.getStackTraceElementMethod
The "getStackTraceElementMethod" method, only available on some JDKs so we use reflection to
find it when available.
|
static java.nio.charset.Charset |
Charsets.ISO_8859_1
ISO-8859-1: ISO Latin Alphabet Number 1 (ISO-LATIN-1).
|
private static java.lang.String |
Throwables.JAVA_LANG_ACCESS_CLASSNAME
JavaLangAccess class name to load using reflection
|
private static java.lang.Object |
Throwables.jla
Access to some fancy internal JVM internals.
|
(package private) static java.lang.String |
Throwables.SHARED_SECRETS_CLASSNAME
SharedSecrets class name to load using reflection
|
static java.nio.charset.Charset |
Charsets.US_ASCII
US-ASCII: seven-bit ASCII, the Basic Latin block of the Unicode character set (ISO646-US).
|
static java.nio.charset.Charset |
Charsets.UTF_16
UTF-16: sixteen-bit UCS Transformation Format, byte order identified by an optional byte-order
mark.
|
static java.nio.charset.Charset |
Charsets.UTF_16BE
UTF-16BE: sixteen-bit UCS Transformation Format, big-endian byte order.
|
static java.nio.charset.Charset |
Charsets.UTF_16LE
UTF-16LE: sixteen-bit UCS Transformation Format, little-endian byte order.
|
| Modifier and Type | Method and Description |
|---|---|
static Predicate<java.lang.Class<?>> |
Predicates.assignableFrom(java.lang.Class<?> clazz)
Deprecated.
Use the correctly-named method
Predicates.subtypeOf(java.lang.Class<?>) instead. |
static Predicate<java.lang.CharSequence> |
Predicates.contains(java.util.regex.Pattern pattern)
Returns a predicate that evaluates to
true if the CharSequence being tested
contains any match for the given regular expression pattern. |
static Predicate<java.lang.CharSequence> |
Predicates.containsPattern(java.lang.String pattern)
Returns a predicate that evaluates to
true if the CharSequence being tested
contains any match for the given regular expression pattern. |
(package private) static <T extends java.lang.Enum<T>> |
Enums.getEnumConstants(java.lang.Class<T> enumClass) |
static java.lang.reflect.Field |
Enums.getField(java.lang.Enum<?> enumValue)
Returns the
Field in which enumValue is defined. |
private static java.lang.reflect.Method |
Throwables.getGetMethod()
Returns the Method that can be used to resolve an individual StackTraceElement, or null if that
method cannot be found (it is only to be found in fairly recent JDKs).
|
private static java.lang.Object |
Throwables.getJLA()
Returns the JavaLangAccess class that is present in all Sun JDKs.
|
private static java.lang.reflect.Method |
Throwables.getJlaMethod(java.lang.String name,
java.lang.Class<?>... parameterTypes) |
private static java.lang.reflect.Method |
Throwables.getSizeMethod()
Returns the Method that can be used to return the size of a stack, or null if that method
cannot be found (it is only to be found in fairly recent JDKs).
|
static java.lang.String |
Throwables.getStackTraceAsString(java.lang.Throwable throwable)
Returns a string containing the result of
toString(), followed by
the full, recursive stack trace of throwable. |
static Predicate<java.lang.Object> |
Predicates.instanceOf(java.lang.Class<?> clazz)
Returns a predicate that evaluates to
true if the object being tested is an instance of
the given class. |
private static java.lang.Object |
Throwables.invokeAccessibleNonThrowingMethod(java.lang.reflect.Method method,
java.lang.Object receiver,
java.lang.Object... params) |
private static boolean |
CharMatcher.isSmall(int totalCharacters,
int tableLength) |
private static java.util.List<java.lang.StackTraceElement> |
Throwables.jlaStackTrace(java.lang.Throwable t) |
static java.util.List<java.lang.StackTraceElement> |
Throwables.lazyStackTrace(java.lang.Throwable throwable)
Returns the stack trace of
throwable, possibly providing slower iteration over the full
trace but faster iteration over parts of the trace. |
static boolean |
Throwables.lazyStackTraceIsLazy()
Returns whether
Throwables.lazyStackTrace(java.lang.Throwable) will use the special implementation described in its
documentation. |
static Splitter |
Splitter.on(java.util.regex.Pattern separatorPattern)
Returns a splitter that considers any subsequence matching
pattern to be a separator. |
static Splitter |
Splitter.onPattern(java.lang.String separatorPattern)
Returns a splitter that considers any subsequence matching a given pattern (regular expression)
to be a separator.
|
private static <T extends java.lang.Enum<T>> |
Enums.populateCache(java.lang.Class<T> enumClass) |
(package private) CharMatcher |
CharMatcher.precomputedInternal()
This is the actual implementation of
CharMatcher.precomputed(), but we bounce calls through a method
on Platform so that we can have different behavior in GWT. |
private static CharMatcher |
CharMatcher.precomputedPositive(int totalCharacters,
java.util.BitSet table,
java.lang.String description)
Helper method for
CharMatcher.precomputedInternal() that doesn't test if the negation is cheaper. |
static java.lang.RuntimeException |
Throwables.propagate(java.lang.Throwable throwable)
Deprecated.
Use
throw e or throw new RuntimeException(e) directly, or use a
combination of Throwables.throwIfUnchecked(java.lang.Throwable) and throw new RuntimeException(e). This
method is scheduled to be removed in July 2018. |
static <X extends java.lang.Throwable> |
Throwables.propagateIfInstanceOf(java.lang.Throwable throwable,
java.lang.Class<X> declaredType)
Deprecated.
Use
Throwables.throwIfInstanceOf(java.lang.Throwable, java.lang.Class<X>), which has the same behavior
but rejects null. This method is scheduled to be removed in July 2018. |
static void |
Throwables.propagateIfPossible(java.lang.Throwable throwable)
Deprecated.
Use
Throwables.throwIfUnchecked(java.lang.Throwable), which has the same behavior but rejects
null. This method is scheduled to be removed in July 2018. |
static <X extends java.lang.Throwable> |
Throwables.propagateIfPossible(java.lang.Throwable throwable,
java.lang.Class<X> declaredType)
Propagates
throwable exactly as-is, if and only if it is an instance of
RuntimeException, Error, or declaredType. |
static <X1 extends java.lang.Throwable,X2 extends java.lang.Throwable> |
Throwables.propagateIfPossible(java.lang.Throwable throwable,
java.lang.Class<X1> declaredType1,
java.lang.Class<X2> declaredType2)
Propagates
throwable exactly as-is, if and only if it is an instance of
RuntimeException, Error, declaredType1, or declaredType2. |
(package private) void |
CharMatcher.setBits(java.util.BitSet table)
Sets bits in
table matched by this matcher. |
(package private) void |
CharMatcher.Whitespace.setBits(java.util.BitSet table) |
(package private) void |
CharMatcher.Negated.setBits(java.util.BitSet table) |
(package private) void |
CharMatcher.And.setBits(java.util.BitSet table) |
(package private) void |
CharMatcher.Or.setBits(java.util.BitSet table) |
(package private) void |
CharMatcher.Is.setBits(java.util.BitSet table) |
(package private) void |
CharMatcher.IsNot.setBits(java.util.BitSet table) |
(package private) void |
CharMatcher.IsEither.setBits(java.util.BitSet table) |
(package private) void |
CharMatcher.AnyOf.setBits(java.util.BitSet table) |
(package private) void |
CharMatcher.InRange.setBits(java.util.BitSet table) |
static Predicate<java.lang.Class<?>> |
Predicates.subtypeOf(java.lang.Class<?> clazz)
Returns a predicate that evaluates to
true if the class being tested is assignable
to (is a subtype of) clazz. |
static <X extends java.lang.Throwable> |
Throwables.throwIfInstanceOf(java.lang.Throwable throwable,
java.lang.Class<X> declaredType)
Throws
throwable if it is an instance of declaredType. |
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractLoadingCache<K,V>
This class provides a skeletal implementation of the
Cache interface to minimize the
effort required to implement this interface. |
class |
CacheBuilderSpec
A specification of a
CacheBuilder configuration. |
class |
ForwardingCache<K,V>
A cache which forwards all its method calls to another cache.
|
class |
ForwardingLoadingCache<K,V>
A cache which forwards all its method calls to another cache.
|
class |
RemovalListeners
A collection of common removal listeners.
|
(package private) class |
Striped64
A package-local class holding common representation and mechanics
for classes supporting dynamic striping on 64bit values.
|
| Modifier and Type | Method and Description |
|---|---|
static <K,V> CacheLoader<K,V> |
CacheLoader.asyncReloading(CacheLoader<K,V> loader,
java.util.concurrent.Executor executor)
Returns a
CacheLoader which wraps loader, executing calls to
CacheLoader.reload(K, V) using executor. |
java.util.Set<java.util.Map.Entry<K,V>> |
LocalCache.entrySet() |
static CacheBuilder<java.lang.Object,java.lang.Object> |
CacheBuilder.from(CacheBuilderSpec spec)
Constructs a new
CacheBuilder instance with the settings specified in spec. |
static CacheBuilder<java.lang.Object,java.lang.Object> |
CacheBuilder.from(java.lang.String spec)
Constructs a new
CacheBuilder instance with the settings specified in spec. |
(package private) CacheBuilder<K,V> |
CacheBuilder.keyEquivalence(Equivalence<java.lang.Object> equivalence)
Sets a custom
Equivalence strategy for comparing keys. |
(package private) CacheBuilder<K,V> |
CacheBuilder.lenientParsing()
Enables lenient parsing.
|
CacheBuilder<K,V> |
CacheBuilder.maximumWeight(long weight)
Specifies the maximum weight of entries the cache may contain.
|
CacheBuilder<K,V> |
CacheBuilder.refreshAfterWrite(long duration,
java.util.concurrent.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.
|
ListenableFuture<V> |
CacheLoader.reload(K key,
V oldValue)
Computes or retrieves a replacement value corresponding to an already-cached
key. |
CacheBuilder<K,V> |
CacheBuilder.softValues()
Specifies that each value (not key) stored in the cache should be wrapped in a
SoftReference (by default, strong references are used). |
(package private) CacheBuilder<K,V> |
CacheBuilder.valueEquivalence(Equivalence<java.lang.Object> equivalence)
Sets a custom
Equivalence strategy for comparing values. |
CacheBuilder<K,V> |
CacheBuilder.weakKeys()
Specifies that each key (not value) stored in the cache should be wrapped in a
WeakReference (by default, strong references are used). |
CacheBuilder<K,V> |
CacheBuilder.weakValues()
Specifies that each value (not key) stored in the cache should be wrapped in a
WeakReference (by default, strong references are used). |
<K1 extends K,V1 extends V> |
CacheBuilder.weigher(Weigher<? super K1,? super V1> weigher)
Specifies the weigher to use in determining the weight of entries.
|
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
AbstractMapBasedMultimap.NavigableAsMap |
(package private) class |
AbstractMapBasedMultimap.NavigableKeySet |
(package private) class |
AbstractMapBasedMultimap.WrappedNavigableSet |
(package private) class |
AbstractNavigableMap<K,V>
Skeletal implementation of
NavigableMap. |
(package private) class |
AbstractRangeSet<C extends java.lang.Comparable>
A skeletal implementation of
RangeSet. |
class |
ConcurrentHashMultiset<E>
A multiset that supports concurrent modifications and that provides atomic versions of most
Multiset operations (exceptions where noted). |
(package private) class |
DescendingImmutableSortedMultiset<E>
A descending wrapper around an
ImmutableSortedMultiset |
(package private) class |
DescendingImmutableSortedSet<E>
Skeletal implementation of
ImmutableSortedSet.descendingSet(). |
private static class |
EmptyContiguousSet.SerializedForm<C extends java.lang.Comparable> |
class |
ForwardingBlockingDeque<E>
A
BlockingDeque which forwards all its method calls to another BlockingDeque. |
class |
ForwardingDeque<E>
A deque which forwards all its method calls to another deque.
|
class |
ForwardingNavigableMap<K,V>
A navigable map which forwards all its method calls to another navigable map.
|
class |
ForwardingNavigableSet<E>
A navigable set which forwards all its method calls to another navigable set.
|
(package private) static class |
ImmutableAsList.SerializedForm
Serialized form that leads to the same performance as the original list.
|
class |
ImmutableClassToInstanceMap<B>
A
ClassToInstanceMap whose contents will never change, with many
other important properties detailed at ImmutableCollection. |
(package private) class |
ImmutableMapEntry<K,V>
Implementation of
Map.Entry for ImmutableMap that adds extra methods to traverse
hash buckets for the key and the value. |
private static class |
ImmutableMapEntrySet.EntrySetSerializedForm<K,V> |
private static class |
ImmutableMapKeySet.KeySetSerializedForm<K> |
private static class |
ImmutableMapValues.SerializedForm<V> |
(package private) static class |
ImmutableMultimap.FieldSettersHolder |
class |
ImmutableRangeMap<K extends java.lang.Comparable<?>,V>
A
RangeMap whose contents will never change, with many other important properties
detailed at ImmutableCollection. |
class |
ImmutableRangeSet<C extends java.lang.Comparable>
A
RangeSet whose contents will never change, with many other important properties
detailed at ImmutableCollection. |
(package private) class |
ImmutableSortedMapFauxverideShim<K,V>
"Overrides" the
ImmutableMap static methods that lack
ImmutableSortedMap equivalents with deprecated, exception-throwing
versions. |
class |
ImmutableSortedMultiset<E>
A
SortedMultiset whose contents will never change, with many other important properties
detailed at ImmutableCollection. |
(package private) class |
ImmutableSortedMultisetFauxverideShim<E>
"Overrides" the
ImmutableMultiset static methods that lack
ImmutableSortedMultiset equivalents with deprecated, exception-throwing versions. |
(package private) class |
ImmutableSortedSetFauxverideShim<E>
"Overrides" the
ImmutableSet static methods that lack
ImmutableSortedSet equivalents with deprecated, exception-throwing
versions. |
interface |
Interner<E>
Provides equivalent behavior to
String.intern() for other immutable
types. |
class |
Interners
Contains static methods pertaining to instances of
Interner. |
(package private) class |
MapMakerInternalMap<K,V,E extends MapMakerInternalMap.InternalEntry<K,V,E>,S extends MapMakerInternalMap.Segment<K,V,E,S>>
The concurrent hash map implementation built by
MapMaker. |
(package private) static class |
Maps.DescendingMap<K,V> |
private static class |
Maps.FilteredEntryNavigableMap<K,V> |
private static class |
Maps.NavigableAsMapView<K,V> |
(package private) static class |
Maps.NavigableKeySet<K,V> |
private static class |
Maps.TransformedEntriesNavigableMap<K,V1,V2> |
(package private) static class |
Maps.UnmodifiableNavigableMap<K,V> |
class |
MutableClassToInstanceMap<B>
A mutable class-to-instance map backed by an arbitrary user-provided map.
|
interface |
RangeMap<K extends java.lang.Comparable,V>
A mapping from disjoint nonempty ranges to non-null values.
|
interface |
RangeSet<C extends java.lang.Comparable>
|
private static class |
RegularContiguousSet.SerializedForm<C extends java.lang.Comparable> |
private static class |
RegularImmutableMap.KeySet.SerializedForm<K> |
private static class |
RegularImmutableMap.Values.SerializedForm<V> |
(package private) class |
RegularImmutableSortedMultiset<E>
An immutable sorted multiset with one or more distinct elements.
|
(package private) class |
Serialization
Provides static methods for serializing collection classes.
|
(package private) static class |
Sets.DescendingSet<E> |
private static class |
Sets.FilteredNavigableSet<E> |
(package private) static class |
Sets.UnmodifiableNavigableSet<E> |
(package private) interface |
SortedMultisetBridge<E>
Superinterface of
SortedMultiset to introduce a bridge method for
elementSet(), to ensure binary compatibility with older Guava versions
that specified elementSet() to return SortedSet. |
(package private) static class |
SortedMultisets.NavigableElementSet<E>
A skeleton navigable implementation for
SortedMultiset.elementSet(). |
private static class |
Synchronized.SynchronizedEntry<K,V> |
(package private) static class |
Synchronized.SynchronizedNavigableMap<K,V> |
(package private) static class |
Synchronized.SynchronizedNavigableSet<E> |
class |
TreeRangeMap<K extends java.lang.Comparable,V>
An implementation of
RangeMap based on a TreeMap, supporting
all optional operations. |
class |
TreeRangeSet<C extends java.lang.Comparable<?>>
An implementation of
RangeSet backed by a TreeMap. |
| Modifier and Type | Field and Description |
|---|---|
(package private) ImmutableSortedSet<E> |
ImmutableSortedSet.descendingSet |
private static long |
AbstractBiMap.serialVersionUID |
private static long |
AbstractBiMap.Inverse.serialVersionUID |
private static long |
AbstractMapBasedMultiset.serialVersionUID |
private static long |
ArrayListMultimap.serialVersionUID |
private static long |
EnumBiMap.serialVersionUID |
private static long |
EnumHashBiMap.serialVersionUID |
private static long |
EnumMultiset.serialVersionUID |
private static long |
HashBiMap.serialVersionUID |
private static long |
HashMultimap.serialVersionUID |
private static long |
HashMultiset.serialVersionUID |
private static long |
ImmutableListMultimap.serialVersionUID |
private static long |
ImmutableSetMultimap.serialVersionUID |
private static long |
LinkedHashMultimap.serialVersionUID |
private static long |
LinkedHashMultiset.serialVersionUID |
private static long |
LinkedListMultimap.serialVersionUID |
private static long |
Multimaps.CustomMultimap.serialVersionUID |
private static long |
Multimaps.CustomListMultimap.serialVersionUID |
private static long |
Multimaps.CustomSetMultimap.serialVersionUID |
private static long |
Multimaps.CustomSortedSetMultimap.serialVersionUID |
private static long |
Synchronized.SynchronizedObject.serialVersionUID |
private static long |
TreeMultimap.serialVersionUID |
private static long |
TreeMultiset.serialVersionUID |
| Modifier and Type | Method and Description |
|---|---|
java.util.NavigableMap<K,java.util.Collection<V>> |
TreeMultimap.asMap()
Returns a map view that associates each key with the corresponding values
in the multimap.
|
static <K,V> java.util.NavigableMap<K,V> |
Maps.asMap(java.util.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.
|
(package private) java.util.NavigableMap<K,java.util.Collection<V>> |
TreeMultimap.backingMap() |
E |
ImmutableSortedSet.ceiling(E e) |
static <T> T[] |
ObjectArrays.concat(T[] first,
T[] second,
java.lang.Class<T> type)
Returns a new array that contains the concatenated contents of two arrays.
|
(package private) int |
ImmutableMultimap.Values.copyIntoArray(java.lang.Object[] dst,
int offset) |
(package private) int |
ImmutableMultiset.copyIntoArray(java.lang.Object[] dst,
int offset) |
(package private) int |
RegularImmutableAsList.copyIntoArray(java.lang.Object[] dst,
int offset) |
(package private) java.util.NavigableMap<K,java.util.Collection<V>> |
TreeMultimap.createAsMap() |
(package private) ImmutableSortedSet<E> |
DescendingImmutableSortedSet.createDescendingSet() |
(package private) ImmutableSortedSet<C> |
EmptyContiguousSet.createDescendingSet() |
(package private) ImmutableSortedSet<E> |
ImmutableSortedSet.createDescendingSet() |
(package private) java.util.NavigableSet<K> |
TreeMultimap.createKeySet() |
UnmodifiableIterator<E> |
DescendingImmutableSortedSet.descendingIterator() |
UnmodifiableIterator<C> |
EmptyContiguousSet.descendingIterator() |
UnmodifiableIterator<C> |
ImmutableRangeSet.AsSet.descendingIterator() |
abstract UnmodifiableIterator<E> |
ImmutableSortedSet.descendingIterator() |
UnmodifiableIterator<C> |
RegularContiguousSet.descendingIterator() |
UnmodifiableIterator<E> |
RegularImmutableSortedSet.descendingIterator() |
ImmutableSortedSet<E> |
DescendingImmutableSortedSet.descendingSet() |
ImmutableSortedSet<E> |
ImmutableSortedSet.descendingSet() |
static <E> int |
Queues.drain(java.util.concurrent.BlockingQueue<E> q,
java.util.Collection<? super E> buffer,
int numElements,
long timeout,
java.util.concurrent.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(java.util.concurrent.BlockingQueue<E> q,
java.util.Collection<? super E> buffer,
int numElements,
long timeout,
java.util.concurrent.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.
|
<T> FluentIterable<T> |
FluentIterable.filter(java.lang.Class<T> type)
Returns the elements from this fluent iterable that are instances of class
type. |
static <T> java.lang.Iterable<T> |
Iterables.filter(java.lang.Iterable<?> unfiltered,
java.lang.Class<T> desiredType)
Returns a view of
unfiltered containing all elements that are of
the type desiredType. |
static <T> UnmodifiableIterator<T> |
Iterators.filter(java.util.Iterator<?> unfiltered,
java.lang.Class<T> desiredType)
Returns a view of
unfiltered containing all elements that are of
the type desiredType. |
static <E> java.util.NavigableSet<E> |
Sets.filter(java.util.NavigableSet<E> unfiltered,
Predicate<? super E> predicate)
Returns the elements of a
NavigableSet, unfiltered, that
satisfy a predicate. |
static <K,V> java.util.NavigableMap<K,V> |
Maps.filterEntries(java.util.NavigableMap<K,V> unfiltered,
Predicate<? super java.util.Map.Entry<K,V>> entryPredicate)
Returns a sorted map containing the mappings in
unfiltered that
satisfy a predicate. |
private static <K,V> java.util.NavigableMap<K,V> |
Maps.filterFiltered(Maps.FilteredEntryNavigableMap<K,V> map,
Predicate<? super java.util.Map.Entry<K,V>> entryPredicate)
Support
clear(), removeAll(), and retainAll() when
filtering a filtered navigable map. |
static <K,V> java.util.NavigableMap<K,V> |
Maps.filterKeys(java.util.NavigableMap<K,V> unfiltered,
Predicate<? super K> keyPredicate)
Returns a navigable map containing the mappings in
unfiltered whose
keys satisfy a predicate. |
static <K,V> java.util.NavigableMap<K,V> |
Maps.filterValues(java.util.NavigableMap<K,V> unfiltered,
Predicate<? super V> valuePredicate)
Returns a navigable map containing the mappings in
unfiltered whose
values satisfy a predicate. |
E |
ImmutableSortedSet.floor(E e) |
static ImmutableMap<java.lang.String,java.lang.String> |
Maps.fromProperties(java.util.Properties properties)
Creates an
ImmutableMap<String, String> from a Properties
instance. |
java.util.NavigableSet<V> |
TreeMultimap.get(K key) |
ContiguousSet<C> |
ContiguousSet.headSet(C toElement,
boolean inclusive) |
ImmutableSortedSet<E> |
ImmutableSortedSet.headSet(E toElement,
boolean inclusive) |
E |
ImmutableSortedSet.higher(E e) |
(package private) int |
EmptyContiguousSet.indexOf(java.lang.Object target) |
int |
ImmutableSortedAsList.indexOf(java.lang.Object target) |
(package private) int |
RegularContiguousSet.indexOf(java.lang.Object target) |
(package private) boolean |
EmptyContiguousSet.isHashCodeFast() |
(package private) boolean |
ImmutableMapEntrySet.isHashCodeFast() |
(package private) MapMaker |
MapMaker.keyEquivalence(Equivalence<java.lang.Object> equivalence)
Sets a custom
Equivalence strategy for comparing keys. |
java.util.NavigableSet<K> |
TreeMultimap.keySet()
Returns a view collection of all distinct keys contained in this
multimap.
|
int |
ImmutableSortedAsList.lastIndexOf(java.lang.Object target) |
E |
ImmutableSortedSet.lower(E e) |
(package private) <K,V> MapMakerInternalMap<K,V,?,?> |
MapMaker.makeCustomMap()
Returns a MapMakerInternalMap for the benefit of internal callers that use features of that
class not exposed through ConcurrentMap.
|
(package private) static <K,V> java.util.NavigableMap<K,V> |
Synchronized.navigableMap(java.util.NavigableMap<K,V> navigableMap) |
(package private) static <K,V> java.util.NavigableMap<K,V> |
Synchronized.navigableMap(java.util.NavigableMap<K,V> navigableMap,
java.lang.Object mutex) |
(package private) static <E> java.util.NavigableSet<E> |
Synchronized.navigableSet(java.util.NavigableSet<E> navigableSet) |
(package private) static <E> java.util.NavigableSet<E> |
Synchronized.navigableSet(java.util.NavigableSet<E> navigableSet,
java.lang.Object mutex) |
static <T> T[] |
ObjectArrays.newArray(java.lang.Class<T> type,
int length)
Returns a new array of the given length with the specified component type.
|
static <E> java.util.concurrent.ArrayBlockingQueue<E> |
Queues.newArrayBlockingQueue(int capacity)
Creates an empty
ArrayBlockingQueue with the given (fixed) capacity
and nonfair access policy. |
static <E> java.util.concurrent.ConcurrentLinkedQueue<E> |
Queues.newConcurrentLinkedQueue()
Creates an empty
ConcurrentLinkedQueue. |
static <E> java.util.concurrent.ConcurrentLinkedQueue<E> |
Queues.newConcurrentLinkedQueue(java.lang.Iterable<? extends E> elements)
Creates a
ConcurrentLinkedQueue containing the elements of the specified iterable,
in the order they are returned by the iterable's iterator. |
static <E> java.util.concurrent.CopyOnWriteArrayList<E> |
Lists.newCopyOnWriteArrayList()
Creates an empty
CopyOnWriteArrayList instance. |
static <E> java.util.concurrent.CopyOnWriteArrayList<E> |
Lists.newCopyOnWriteArrayList(java.lang.Iterable<? extends E> elements)
Creates a
CopyOnWriteArrayList instance containing the given elements. |
static <E> java.util.concurrent.CopyOnWriteArraySet<E> |
Sets.newCopyOnWriteArraySet()
Creates an empty
CopyOnWriteArraySet instance. |
static <E> java.util.concurrent.CopyOnWriteArraySet<E> |
Sets.newCopyOnWriteArraySet(java.lang.Iterable<? extends E> elements)
Creates a
CopyOnWriteArraySet instance containing the given elements. |
static <E> java.util.concurrent.LinkedBlockingDeque<E> |
Queues.newLinkedBlockingDeque()
Creates an empty
LinkedBlockingDeque with a capacity of Integer.MAX_VALUE. |
static <E> java.util.concurrent.LinkedBlockingDeque<E> |
Queues.newLinkedBlockingDeque(int capacity)
Creates an empty
LinkedBlockingDeque with the given (fixed) capacity. |
static <E> java.util.concurrent.LinkedBlockingDeque<E> |
Queues.newLinkedBlockingDeque(java.lang.Iterable<? extends E> elements)
Creates a
LinkedBlockingDeque with a capacity of Integer.MAX_VALUE,
containing the elements of the specified iterable,
in the order they are returned by the iterable's iterator. |
static <E> java.util.concurrent.LinkedBlockingQueue<E> |
Queues.newLinkedBlockingQueue()
Creates an empty
LinkedBlockingQueue with a capacity of Integer.MAX_VALUE. |
static <E> java.util.concurrent.LinkedBlockingQueue<E> |
Queues.newLinkedBlockingQueue(int capacity)
Creates an empty
LinkedBlockingQueue with the given (fixed) capacity. |
static <E> java.util.concurrent.LinkedBlockingQueue<E> |
Queues.newLinkedBlockingQueue(java.lang.Iterable<? extends E> elements)
Creates a
LinkedBlockingQueue with a capacity of Integer.MAX_VALUE,
containing the elements of the specified iterable,
in the order they are returned by the iterable's iterator. |
static <E extends java.lang.Comparable> |
Queues.newPriorityBlockingQueue()
Creates an empty
PriorityBlockingQueue with the ordering given by its
elements' natural ordering. |
static <E extends java.lang.Comparable> |
Queues.newPriorityBlockingQueue(java.lang.Iterable<? extends E> elements)
Creates a
PriorityBlockingQueue containing the given elements. |
static <E> java.util.concurrent.SynchronousQueue<E> |
Queues.newSynchronousQueue()
Creates an empty
SynchronousQueue with nonfair access policy. |
static <E> Interner<E> |
Interners.newWeakInterner()
Returns a new thread-safe interner which retains a weak reference to each instance it has
interned, and so does not prevent these instances from being garbage-collected.
|
private static <K,V> java.util.Map.Entry<K,V> |
Synchronized.nullableSynchronizedEntry(java.util.Map.Entry<K,V> entry,
java.lang.Object mutex) |
E |
ImmutableSortedSet.pollFirst()
Deprecated.
Unsupported operation.
|
E |
ImmutableSortedSet.pollLast()
Deprecated.
Unsupported operation.
|
private void |
AbstractBiMap.Inverse.readObject(java.io.ObjectInputStream stream) |
private void |
ArrayListMultimap.readObject(java.io.ObjectInputStream stream) |
private void |
EnumBiMap.readObject(java.io.ObjectInputStream stream) |
private void |
EnumHashBiMap.readObject(java.io.ObjectInputStream stream) |
private void |
EnumMultiset.readObject(java.io.ObjectInputStream stream) |
private void |
HashBiMap.readObject(java.io.ObjectInputStream stream) |
private void |
HashMultimap.readObject(java.io.ObjectInputStream stream) |
private void |
HashMultiset.readObject(java.io.ObjectInputStream stream) |
private void |
ImmutableAsList.readObject(java.io.ObjectInputStream stream) |
private void |
ImmutableListMultimap.readObject(java.io.ObjectInputStream stream) |
private void |
ImmutableSetMultimap.readObject(java.io.ObjectInputStream stream) |
private void |
LinkedHashMultimap.readObject(java.io.ObjectInputStream stream) |
private void |
LinkedHashMultiset.readObject(java.io.ObjectInputStream stream) |
private void |
LinkedListMultimap.readObject(java.io.ObjectInputStream stream) |
private void |
Multimaps.CustomMultimap.readObject(java.io.ObjectInputStream stream) |
private void |
Multimaps.CustomListMultimap.readObject(java.io.ObjectInputStream stream) |
private void |
Multimaps.CustomSetMultimap.readObject(java.io.ObjectInputStream stream) |
private void |
Multimaps.CustomSortedSetMultimap.readObject(java.io.ObjectInputStream stream) |
private void |
TreeMultimap.readObject(java.io.ObjectInputStream stream) |
private void |
TreeMultiset.readObject(java.io.ObjectInputStream stream) |
private void |
AbstractMapBasedMultiset.readObjectNoData() |
(package private) java.lang.Object |
AbstractBiMap.Inverse.readResolve() |
private static <E> java.util.NavigableSet<E> |
Maps.removeOnlyNavigableSet(java.util.NavigableSet<E> set) |
(package private) ImmutableList<E> |
ImmutableSortedAsList.subListUnchecked(int fromIndex,
int toIndex) |
static <K extends java.lang.Comparable<? super K>,V> |
Maps.subMap(java.util.NavigableMap<K,V> map,
Range<K> range)
Returns a view of the portion of
map whose keys are contained by range. |
ContiguousSet<C> |
ContiguousSet.subSet(C fromElement,
boolean fromInclusive,
C toElement,
boolean toInclusive) |
ImmutableSortedSet<E> |
ImmutableSortedSet.subSet(E fromElement,
boolean fromInclusive,
E toElement,
boolean toInclusive) |
static <K extends java.lang.Comparable<? super K>> |
Sets.subSet(java.util.NavigableSet<K> set,
Range<K> range)
Returns a view of the portion of
set whose elements are contained by range. |
static <K,V> java.util.NavigableMap<K,V> |
Maps.synchronizedNavigableMap(java.util.NavigableMap<K,V> navigableMap)
Returns a synchronized (thread-safe) navigable map backed by the specified
navigable map.
|
static <E> java.util.NavigableSet<E> |
Sets.synchronizedNavigableSet(java.util.NavigableSet<E> navigableSet)
Returns a synchronized (thread-safe) navigable set backed by the specified
navigable set.
|
ContiguousSet<C> |
ContiguousSet.tailSet(C fromElement,
boolean inclusive) |
ImmutableSortedSet<E> |
ImmutableSortedSet.tailSet(E fromElement,
boolean inclusive) |
E[] |
FluentIterable.toArray(java.lang.Class<E> type)
Returns an array containing all of the elements from this fluent iterable in iteration order.
|
V[][] |
ArrayTable.toArray(java.lang.Class<V> valueClass)
Returns a two-dimensional array with the table contents.
|
static <T> T[] |
Iterables.toArray(java.lang.Iterable<? extends T> iterable,
java.lang.Class<T> type)
Copies an iterable's elements into an array.
|
static <T> T[] |
Iterators.toArray(java.util.Iterator<? extends T> iterator,
java.lang.Class<T> type)
Copies an iterator's elements into an array.
|
static <K,V1,V2> java.util.NavigableMap<K,V2> |
Maps.transformEntries(java.util.NavigableMap<K,V1> fromMap,
Maps.EntryTransformer<? super K,? super V1,V2> transformer)
Returns a view of a navigable map whose values are derived from the
original navigable map's entries.
|
static <K,V1,V2> java.util.NavigableMap<K,V2> |
Maps.transformValues(java.util.NavigableMap<K,V1> fromMap,
Function<? super V1,V2> function)
Returns a view of a navigable map where each value is transformed by a
function.
|
(package private) java.util.Collection<V> |
TreeMultimap.unmodifiableCollectionSubclass(java.util.Collection<V> collection) |
static <K,V> java.util.NavigableMap<K,V> |
Maps.unmodifiableNavigableMap(java.util.NavigableMap<K,? extends V> map)
Returns an unmodifiable view of the specified navigable map.
|
static <E> java.util.NavigableSet<E> |
Sets.unmodifiableNavigableSet(java.util.NavigableSet<E> set)
Returns an unmodifiable view of the specified navigable set.
|
MapMaker |
MapMaker.weakKeys()
Specifies that each key (not value) stored in the map should be wrapped in a
WeakReference (by default, strong references are used). |
MapMaker |
MapMaker.weakValues()
Specifies that each value (not key) stored in the map should be wrapped in a
WeakReference (by default, strong references are used). |
(package private) java.util.Collection<V> |
TreeMultimap.wrapCollection(K key,
java.util.Collection<V> collection) |
private void |
AbstractBiMap.Inverse.writeObject(java.io.ObjectOutputStream stream) |
private void |
ArrayListMultimap.writeObject(java.io.ObjectOutputStream stream) |
private void |
EnumBiMap.writeObject(java.io.ObjectOutputStream stream) |
private void |
EnumHashBiMap.writeObject(java.io.ObjectOutputStream stream) |
private void |
EnumMultiset.writeObject(java.io.ObjectOutputStream stream) |
private void |
HashBiMap.writeObject(java.io.ObjectOutputStream stream) |
private void |
HashMultimap.writeObject(java.io.ObjectOutputStream stream) |
private void |
HashMultiset.writeObject(java.io.ObjectOutputStream stream) |
private void |
ImmutableListMultimap.writeObject(java.io.ObjectOutputStream stream) |
private void |
ImmutableSetMultimap.writeObject(java.io.ObjectOutputStream stream) |
private void |
LinkedHashMultimap.writeObject(java.io.ObjectOutputStream stream) |
private void |
LinkedHashMultiset.writeObject(java.io.ObjectOutputStream stream) |
private void |
LinkedListMultimap.writeObject(java.io.ObjectOutputStream stream) |
private void |
Multimaps.CustomMultimap.writeObject(java.io.ObjectOutputStream stream) |
private void |
Multimaps.CustomListMultimap.writeObject(java.io.ObjectOutputStream stream) |
private void |
Multimaps.CustomSetMultimap.writeObject(java.io.ObjectOutputStream stream) |
private void |
Multimaps.CustomSortedSetMultimap.writeObject(java.io.ObjectOutputStream stream) |
private void |
Synchronized.SynchronizedObject.writeObject(java.io.ObjectOutputStream stream) |
private void |
TreeMultimap.writeObject(java.io.ObjectOutputStream stream) |
private void |
TreeMultiset.writeObject(java.io.ObjectOutputStream stream) |
(package private) java.lang.Object |
EmptyContiguousSet.writeReplace() |
(package private) java.lang.Object |
ImmutableAsList.writeReplace() |
(package private) java.lang.Object |
ImmutableMapEntrySet.writeReplace() |
(package private) java.lang.Object |
ImmutableMapKeySet.writeReplace() |
(package private) java.lang.Object |
ImmutableMapValues.writeReplace() |
(package private) java.lang.Object |
RegularContiguousSet.writeReplace() |
(package private) java.lang.Object |
RegularImmutableMap.KeySet.writeReplace() |
(package private) java.lang.Object |
RegularImmutableMap.Values.writeReplace() |
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractCollectionTestSuiteBuilder<B extends AbstractCollectionTestSuiteBuilder<B,E>,E>
Abstract superclass of all test-suite builders for collection interfaces.
|
class |
CollectionTestSuiteBuilder<E>
Concrete instantiation of
AbstractCollectionTestSuiteBuilder for
testing collections that do not have a more specific tester like
ListTestSuiteBuilder or SetTestSuiteBuilder. |
class |
ConcurrentMapTestSuiteBuilder<K,V>
Creates, based on your criteria, a JUnit test suite that exhaustively tests a ConcurrentMap
implementation.
|
class |
ConcurrentNavigableMapTestSuiteBuilder<K,V>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
a ConcurrentNavigableMap implementation.
|
class |
DerivedIteratorTestSuiteBuilder<E>
Given a test iterable generator, builds a test suite for the
iterable's iterator, by delegating to a
IteratorTestSuiteBuilder. |
class |
FeatureSpecificTestSuiteBuilder<B extends FeatureSpecificTestSuiteBuilder<B,G>,G>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
the object generated by a G, selecting appropriate tests by matching them
against specified features.
|
class |
IteratorTestSuiteBuilder<E>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
an Iterator implementation.
|
class |
ListTestSuiteBuilder<E>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
a List implementation.
|
class |
MapTestSuiteBuilder<K,V>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
a Map implementation.
|
class |
NavigableMapTestSuiteBuilder<K,V>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
a NavigableMap implementation.
|
class |
NavigableSetTestSuiteBuilder<E>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
a NavigableSet implementation.
|
class |
PerCollectionSizeTestSuiteBuilder<B extends PerCollectionSizeTestSuiteBuilder<B,G,T,E>,G extends TestContainerGenerator<T,E>,T,E>
This builder creates a composite test suite, containing a separate test suite
for each
CollectionSize present in the features specified
by FeatureSpecificTestSuiteBuilder.withFeatures(Feature...). |
class |
QueueTestSuiteBuilder<E>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
a queue implementation.
|
class |
ReserializingTestCollectionGenerator<E>
Reserializes the sets created by another test set generator.
|
class |
ReserializingTestSetGenerator<E>
Reserializes the sets created by another test set generator.
|
class |
SafeTreeMap<K,V>
A wrapper around
TreeMap that aggressively checks to see if keys are
mutually comparable. |
class |
SafeTreeSet<E>
A wrapper around
TreeSet that aggressively checks to see if elements
are mutually comparable. |
class |
SetTestSuiteBuilder<E>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
a Set implementation.
|
class |
SortedMapTestSuiteBuilder<K,V>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
a SortedMap implementation.
|
class |
SortedSetTestSuiteBuilder<E>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
a SortedSet implementation.
|
class |
TestsForListsInJavaUtil
Generates a test suite covering the
List implementations in the
java.util package. |
class |
TestsForMapsInJavaUtil
Generates a test suite covering the
Map implementations in the
java.util package. |
class |
TestsForQueuesInJavaUtil
Generates a test suite covering the
Queue implementations in the
java.util package. |
class |
TestsForSetsInJavaUtil
Generates a test suite covering the
Set implementations in the
java.util package. |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.reflect.Method |
Helpers.getMethod(java.lang.Class<?> clazz,
java.lang.String name) |
| Modifier and Type | Class and Description |
|---|---|
class |
FeatureUtil
Utilities for collecting and validating tester requirements from annotations.
|
| Modifier and Type | Class and Description |
|---|---|
class |
BiMapTestSuiteBuilder<K,V>
Creates, based on your criteria, a JUnit test suite that exhaustively tests a
BiMap
implementation. |
class |
ListMultimapTestSuiteBuilder<K,V>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
a
ListMultimap implementation. |
class |
MultimapTestSuiteBuilder<K,V,M extends Multimap<K,V>>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
a
Multimap implementation. |
class |
MultisetTestSuiteBuilder<E>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
a
Multiset implementation. |
static class |
SetGenerators.ContiguousSetDescendingGenerator |
static class |
SetGenerators.ImmutableSortedSetDescendingAsListGenerator |
static class |
SetGenerators.ImmutableSortedSetDescendingGenerator |
class |
SetMultimapTestSuiteBuilder<K,V>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
a
SetMultimap implementation. |
class |
SortedMultisetTestSuiteBuilder<E>
Creates, based on your criteria, a JUnit test suite that exhaustively tests a
SortedMultiset implementation. |
class |
SortedSetMultimapTestSuiteBuilder<K,V>
Creates, based on your criteria, a JUnit test suite that exhaustively tests
a
SortedSetMultimap implementation. |
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<java.lang.reflect.Method> |
MultisetCountTester.getCountDuplicateInitializingMethods()
Returns
Method instances for the read tests that assume multisets
support duplicates so that the test of Multisets.forSet() can
suppress them. |
static java.util.List<java.lang.reflect.Method> |
BiMapInverseTester.getInverseSameAfterSerializingMethods()
Returns
Method instances for the tests that assume that the inverse will be the same
after serialization. |
static java.util.List<java.lang.reflect.Method> |
MultisetIteratorTester.getIteratorDuplicateInitializingMethods()
Returns
Method instances for the tests that assume multisets support duplicates so that
the test of Multisets.forSet() can suppress them. |
private static java.lang.reflect.Method |
AbstractMultisetSetCountTester.getMethod(java.lang.String methodName) |
private static java.lang.reflect.Method |
BiMapInverseTester.getMethod(java.lang.String methodName) |
static java.util.List<java.lang.reflect.Method> |
MultisetRemoveTester.getRemoveDuplicateInitializingMethods()
Returns
Method instances for the remove tests that assume multisets
support duplicates so that the test of Multisets.forSet() can
suppress them. |
static java.util.List<java.lang.reflect.Method> |
AbstractMultisetSetCountTester.getSetCountDuplicateInitializingMethods()
Returns
Method instances for the setCount() tests that
assume multisets support duplicates so that the test of Multisets.forSet() can suppress them. |
| Modifier and Type | Class and Description |
|---|---|
class |
NavigableMapNavigationTester<K,V>
A generic JUnit test which tests operations on a NavigableMap.
|
class |
NavigableSetNavigationTester<E>
A generic JUnit test which tests operations on a NavigableSet.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.reflect.Method |
CollectionAddAllTester.getAddAllNullUnsupportedMethod()
Returns the
Method instance for CollectionAddAllTester.testAddAll_nullUnsupported() so that tests can suppress it with FeatureSpecificTestSuiteBuilder.suppressing() until Sun
bug 5045147 is fixed. |
static java.lang.reflect.Method |
CollectionAddAllTester.getAddAllUnsupportedNonePresentMethod()
Returns the
Method instance for CollectionAddAllTester.testAddAll_unsupportedNonePresent() so that tests can suppress it with
FeatureSpecificTestSuiteBuilder.suppressing() while we figure out
what to do with ConcurrentHashMap
support for entrySet().add(). |
static java.lang.reflect.Method |
CollectionAddAllTester.getAddAllUnsupportedSomePresentMethod()
Returns the
Method instance for CollectionAddAllTester.testAddAll_unsupportedSomePresent() so that tests can suppress it with
FeatureSpecificTestSuiteBuilder.suppressing() while we figure out
what to do with ConcurrentHashMap
support for entrySet().add(). |
static java.lang.reflect.Method |
CollectionAddTester.getAddNullSupportedMethod()
Returns the
Method instance for CollectionAddTester.testAdd_nullSupported() so
that tests of Collections.checkedCollection(java.util.Collection, Class) can
suppress it with FeatureSpecificTestSuiteBuilder.suppressing()
until Sun bug
6409434 is fixed. |
static java.lang.reflect.Method |
ListAddAtIndexTester.getAddNullSupportedMethod()
Returns the
Method instance for
ListAddAtIndexTester.testAddAtIndex_nullSupported() so that tests can suppress it. |
static java.lang.reflect.Method |
CollectionAddTester.getAddNullUnsupportedMethod()
Returns the
Method instance for CollectionAddTester.testAdd_nullSupported()
so that tests of TreeSet can suppress it with FeatureSpecificTestSuiteBuilder.suppressing() until Sun bug
5045147 is fixed. |
static java.lang.reflect.Method |
ListAddTester.getAddSupportedNullPresentMethod()
Returns the
Method instance for
ListAddTester.testAdd_supportedNullPresent() so that tests can suppress it. |
static java.lang.reflect.Method |
SetAddTester.getAddSupportedNullPresentMethod()
Returns the
Method instance for
SetAddTester.testAdd_supportedNullPresent() so that tests can suppress it. |
static java.lang.reflect.Method |
CollectionAddTester.getAddUnsupportedNotPresentMethod()
Returns the
Method instance for CollectionAddTester.testAdd_unsupportedNotPresent() so that tests can suppress it with
FeatureSpecificTestSuiteBuilder.suppressing() while we figure out
what to do with ConcurrentHashMap
support for entrySet().add(). |
static java.lang.reflect.Method |
MapEntrySetTester.getContainsEntryWithIncomparableKeyMethod() |
static java.lang.reflect.Method |
MapEntrySetTester.getContainsEntryWithIncomparableValueMethod() |
static java.lang.reflect.Method |
MapCreationTester.getCreateWithNullKeyUnsupportedMethod()
Returns the
Method instance for MapCreationTester.testCreateWithNullKeyUnsupported() so that tests can suppress it
with FeatureSpecificTestSuiteBuilder.suppressing() until Sun
bug 5045147 is fixed. |
static java.lang.reflect.Method |
CollectionCreationTester.getCreateWithNullUnsupportedMethod()
Returns the
Method instance for CollectionCreationTester.testCreateWithNull_unsupported() so that tests can suppress it
with FeatureSpecificTestSuiteBuilder.suppressing() until Sun
bug 5045147 is fixed. |
static java.lang.reflect.Method |
ListHashCodeTester.getHashCodeMethod()
Returns the
Method instance for ListHashCodeTester.testHashCode() so that
list tests on unhashable objects can suppress it with
FeatureSpecificTestSuiteBuilder.suppressing(). |
static java.lang.reflect.Method[] |
SetHashCodeTester.getHashCodeMethods()
Returns the
Method instances for the test methods in this class
which call hashCode() on the set values so that set tests on
unhashable objects can suppress it with
FeatureSpecificTestSuiteBuilder.suppressing(). |
static java.lang.reflect.Method |
ListListIteratorTester.getListIteratorFullyModifiableMethod()
Returns the
Method instance for
ListListIteratorTester.testListIterator_fullyModifiable() so that tests of
CopyOnWriteArraySet can suppress it with
FeatureSpecificTestSuiteBuilder.suppressing() until Sun bug
6570575 is fixed. |
static java.lang.reflect.Method |
ListListIteratorTester.getListIteratorUnmodifiableMethod()
Returns the
Method instance for
ListListIteratorTester.testListIterator_unmodifiable() so that it can be suppressed in
GWT tests. |
static java.lang.reflect.Method |
MapPutAllTester.getPutAllNullKeyUnsupportedMethod()
Returns the
Method instance for MapPutAllTester.testPutAll_nullKeyUnsupported() so that tests can suppress it with FeatureSpecificTestSuiteBuilder.suppressing() until Sun
bug 5045147 is fixed. |
static java.lang.reflect.Method |
MapPutTester.getPutNullKeyUnsupportedMethod()
Returns the
Method instance for MapPutTester.testPut_nullKeyUnsupported() so that tests of TreeMap
can suppress it with FeatureSpecificTestSuiteBuilder.suppressing()
until Sun bug
5045147 is fixed. |
static java.lang.reflect.Method |
ListSetTester.getSetNullSupportedMethod()
Returns the
Method instance for
ListSetTester.testSet_null() so that tests of Collections.checkedCollection(java.util.Collection, Class) can
suppress it with FeatureSpecificTestSuiteBuilder.suppressing()
until Sun bug
6409434 is fixed. |
static java.lang.reflect.Method |
MapEntrySetTester.getSetValueMethod() |
static java.lang.reflect.Method |
ListSubListTester.getSubListOriginalListSetAffectsSubListLargeListMethod()
Returns the
Method instance for
ListSubListTester.testSubList_originalListSetAffectsSubListLargeList() ()} so that
tests of CopyOnWriteArrayList can suppress them with
FeatureSpecificTestSuiteBuilder.suppressing() until Sun bug
6570631 is fixed. |
static java.lang.reflect.Method |
ListSubListTester.getSubListOriginalListSetAffectsSubListMethod()
Returns the
Method instance for
ListSubListTester.testSubList_originalListSetAffectsSubList() so that tests
of CopyOnWriteArrayList can suppress them with
FeatureSpecificTestSuiteBuilder.suppressing() until Sun bug
6570631 is fixed. |
static java.lang.reflect.Method |
ListSubListTester.getSubListSubListRemoveAffectsOriginalLargeListMethod()
Returns the
Method instance for
ListSubListTester.testSubList_subListRemoveAffectsOriginalLargeList() so that tests
of CopyOnWriteArrayList can suppress it with
FeatureSpecificTestSuiteBuilder.suppressing() until Sun bug
6570575 is fixed. |
static java.lang.reflect.Method |
CollectionToArrayTester.getToArrayIsPlainObjectArrayMethod()
Returns the
Method instance for
CollectionToArrayTester.testToArray_isPlainObjectArray() so that tests of
Arrays.asList(Object[]) can suppress it with FeatureSpecificTestSuiteBuilder.suppressing() until Sun bug
6260652 is fixed. |
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
AppendableWriter
Writer that places all output on an
Appendable target. |
interface |
ByteArrayDataInput
An extension of
DataInput for reading from in-memory byte arrays; its methods offer
identical functionality but do not throw IOException. |
interface |
ByteArrayDataOutput
An extension of
DataOutput for writing to in-memory byte arrays; its methods offer
identical functionality but do not throw IOException. |
interface |
ByteProcessor<T>
A callback interface to process bytes from a stream.
|
class |
ByteSink
A destination to which bytes can be written, such as a file.
|
class |
ByteSource
A readable source of bytes, such as a file.
|
class |
ByteStreams
Provides utility methods for working with byte arrays and I/O streams.
|
(package private) class |
CharSequenceReader
A
Reader that reads the characters in a CharSequence. |
class |
CharSink
A destination to which characters can be written, such as a text file.
|
class |
CharSource
A readable source of characters, such as a text file.
|
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 |
FileWriteMode
Modes for opening a file for writing.
|
class |
Flushables
Utility methods for working with
Flushable objects. |
(package private) class |
LineBuffer
Package-protected abstract class that implements the line reading algorithm used by
LineReader. |
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. |
(package private) class |
MultiInputStream
An
InputStream that concatenates multiple substreams. |
(package private) class |
MultiReader
A
Reader that concatenates multiple readers. |
class |
PatternFilenameFilter
File name filter that only accepts files matching a regular expression.
|
(package private) class |
ReaderInputStream
An
InputStream that converts characters from a Reader into bytes using an
arbitrary Charset. |
class |
Resources
Provides utility methods for working with resources in the classpath.
|
| Modifier and Type | Method and Description |
|---|---|
ByteSource |
BaseEncoding.decodingSource(CharSource encodedSource)
Returns a
ByteSource that reads base-encoded bytes from the specified
CharSource. |
abstract java.io.InputStream |
BaseEncoding.decodingStream(java.io.Reader reader)
Returns an
InputStream that decodes base-encoded input from the specified
Reader. |
java.io.InputStream |
BaseEncoding.StandardBaseEncoding.decodingStream(java.io.Reader reader) |
java.io.InputStream |
BaseEncoding.SeparatedBaseEncoding.decodingStream(java.io.Reader reader) |
ByteSink |
BaseEncoding.encodingSink(CharSink encodedSink)
Returns a
ByteSink that writes base-encoded bytes to the specified CharSink. |
abstract java.io.OutputStream |
BaseEncoding.encodingStream(java.io.Writer writer)
Returns an
OutputStream that encodes bytes using this encoding into the specified
Writer. |
java.io.OutputStream |
BaseEncoding.StandardBaseEncoding.encodingStream(java.io.Writer out) |
java.io.OutputStream |
BaseEncoding.SeparatedBaseEncoding.encodingStream(java.io.Writer output) |
(package private) static java.io.Reader |
BaseEncoding.ignoringReader(java.io.Reader delegate,
CharMatcher toIgnore) |
(package private) static java.io.Writer |
BaseEncoding.separatingWriter(java.io.Writer delegate,
java.lang.String separator,
int afterEveryChars) |
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
DoubleUtils
Utilities for
double primitives. |
class |
LinearTransformation
The representation of a linear transformation between real numbers
x and y. |
class |
PairedStats
An immutable value object capturing some basic statistics about a collection of paired double
values (e.g.
|
class |
PairedStatsAccumulator
A mutable object which accumulates paired double values (e.g.
|
class |
Quantiles
Provides a fluent API for calculating
quantiles.
|
class |
Stats
A bundle of statistical summary values -- sum, count, mean/average, min and max, and several
forms of variance -- that were computed from a single set of zero or more floating-point values.
|
class |
StatsAccumulator
A mutable object which accumulates double values and tracks some basic statistics over all the
values added so far.
|
| Modifier and Type | Field and Description |
|---|---|
(package private) static long[] |
LongMath.halfPowersOf10 |
(package private) static long[] |
LongMath.powersOf10 |
| Modifier and Type | Method and Description |
|---|---|
static int |
IntMath.binomial(int n,
int k)
Returns
n choose k, also known as the binomial coefficient of n and
k, or Integer.MAX_VALUE if the result does not fit in an int. |
static long |
LongMath.checkedAdd(long a,
long b)
Returns the sum of
a and b, provided it does not overflow. |
static long |
LongMath.checkedMultiply(long a,
long b)
Returns the product of
a and b, provided it does not overflow. |
static long |
LongMath.checkedPow(long b,
int k)
Returns the
b to the kth power, provided it does not overflow. |
static long |
LongMath.checkedSubtract(long a,
long b)
Returns the difference of
a and b, provided it does not overflow. |
private static double |
DoubleMath.checkFinite(double argument) |
static java.math.BigInteger |
BigIntegerMath.divide(java.math.BigInteger p,
java.math.BigInteger q,
java.math.RoundingMode mode)
Returns the result of dividing
p by q, rounding using the specified
RoundingMode. |
static long |
LongMath.divide(long p,
long q,
java.math.RoundingMode mode)
Returns the result of dividing
p by q, rounding using the specified
RoundingMode. |
static long |
LongMath.factorial(int n)
Returns
n!, that is, the product of the first n positive integers, 1 if
n == 0, or Long.MAX_VALUE if the result does not fit in a long. |
(package private) static boolean |
BigIntegerMath.fitsInLong(java.math.BigInteger x) |
static boolean |
DoubleMath.isMathematicalInteger(double x)
Returns
true if x represents a mathematical integer. |
static boolean |
DoubleMath.isPowerOfTwo(double x)
Returns
true if x is exactly equal to 2^k for some finite integer
k. |
static boolean |
IntMath.isPrime(int n)
Returns
true if n is a
prime number: an integer greater
than one that cannot be factored into a product of smaller positive integers. |
static boolean |
LongMath.isPrime(long n)
Returns
true if n is a
prime number: an integer greater
than one that cannot be factored into a product of smaller positive integers. |
static int |
BigIntegerMath.log10(java.math.BigInteger x,
java.math.RoundingMode mode)
Returns the base-10 logarithm of
x, rounded according to the specified rounding mode. |
static int |
IntMath.log10(int x,
java.math.RoundingMode mode)
Returns the base-10 logarithm of
x, rounded according to the specified rounding mode. |
static int |
LongMath.log10(long x,
java.math.RoundingMode mode)
Returns the base-10 logarithm of
x, rounded according to the specified rounding mode. |
(package private) static int |
LongMath.log10Floor(long x) |
static int |
DoubleMath.log2(double x,
java.math.RoundingMode mode)
Returns the base 2 logarithm of a double value, rounded with the specified rounding mode to an
int. |
static double |
DoubleMath.mean(double... values)
Deprecated.
Use
Stats.meanOf(java.lang.Iterable<? extends java.lang.Number>) instead, noting the less strict handling of non-finite
values. This method will be removed in February 2018. |
static double |
DoubleMath.mean(java.lang.Iterable<? extends java.lang.Number> values)
Deprecated.
Use
Stats.meanOf(java.lang.Iterable<? extends java.lang.Number>) instead, noting the less strict handling of non-finite
values. This method will be removed in February 2018. |
static double |
DoubleMath.mean(java.util.Iterator<? extends java.lang.Number> values)
Deprecated.
Use
Stats.meanOf(java.lang.Iterable<? extends java.lang.Number>) instead, noting the less strict handling of non-finite
values. This method will be removed in February 2018. |
static int |
LongMath.mod(long x,
int m)
Returns
x mod m, a non-negative value less than m. |
static long |
LongMath.mod(long x,
long m)
Returns
x mod m, a non-negative value less than m. |
static int |
IntMath.pow(int b,
int k)
Returns
b to the kth power. |
static long |
LongMath.pow(long b,
int k)
Returns
b to the kth power. |
(package private) static double |
DoubleMath.roundIntermediate(double x,
java.math.RoundingMode mode) |
static java.math.BigInteger |
DoubleMath.roundToBigInteger(double x,
java.math.RoundingMode mode)
Returns the
BigInteger value that is equal to x rounded with the specified
rounding mode, if possible. |
static int |
DoubleMath.roundToInt(double x,
java.math.RoundingMode mode)
Returns the
int value that is equal to x rounded with the specified rounding
mode, if possible. |
static long |
DoubleMath.roundToLong(double x,
java.math.RoundingMode mode)
Returns the
long value that is equal to x rounded with the specified rounding
mode, if possible. |
static java.math.BigInteger |
BigIntegerMath.sqrt(java.math.BigInteger x,
java.math.RoundingMode mode)
Returns the square root of
x, rounded with the specified rounding mode. |
static int |
IntMath.sqrt(int x,
java.math.RoundingMode mode)
Returns the square root of
x, rounded with the specified rounding mode. |
static long |
LongMath.sqrt(long x,
java.math.RoundingMode mode)
Returns the square root of
x, rounded with the specified rounding mode. |
private static java.math.BigInteger |
BigIntegerMath.sqrtApproxWithDoubles(java.math.BigInteger x) |
private static java.math.BigInteger |
BigIntegerMath.sqrtFloor(java.math.BigInteger x) |
| Modifier and Type | Class and Description |
|---|---|
class |
HostSpecifier
A syntactically valid host specifier, suitable for use in a URI.
|
class |
InetAddresses
Static utility methods pertaining to
InetAddress instances. |
| Modifier and Type | Class and Description |
|---|---|
class |
Primitives
Contains static utility methods pertaining to primitive types and their corresponding wrapper
types.
|
class |
UnsignedBytes
Static utility methods pertaining to
byte primitives that interpret values as
unsigned (that is, any negative value b is treated as the positive value
256 + b). |
| Modifier and Type | Field and Description |
|---|---|
(package private) static java.util.regex.Pattern |
Doubles.FLOATING_POINT_PATTERN
This is adapted from the regex suggested by
Double.valueOf(String) for prevalidating
inputs. |
| Modifier and Type | Method and Description |
|---|---|
private static java.util.regex.Pattern |
Doubles.fpPattern() |
static char |
Chars.fromByteArray(byte[] bytes)
Returns the
char value whose big-endian representation is stored in the first 2 bytes
of bytes; equivalent to ByteBuffer.wrap(bytes).getChar(). |
static int |
Ints.fromByteArray(byte[] bytes)
Returns the
int value whose big-endian representation is stored in the first 4 bytes of
bytes; equivalent to ByteBuffer.wrap(bytes).getInt(). |
static short |
Shorts.fromByteArray(byte[] bytes)
Returns the
short value whose big-endian representation is stored in the first 2 bytes
of bytes; equivalent to ByteBuffer.wrap(bytes).getShort(). |
static char |
Chars.fromBytes(byte b1,
byte b2)
Returns the
char value whose byte representation is the given 2 bytes, in big-endian
order; equivalent to Chars.fromByteArray(new byte[] {b1, b2}). |
static short |
Shorts.fromBytes(byte b1,
byte b2)
Returns the
short value whose byte representation is the given 2 bytes, in big-endian
order; equivalent to Shorts.fromByteArray(new byte[] {b1, b2}). |
static int |
Ints.fromBytes(byte b1,
byte b2,
byte b3,
byte b4)
Returns the
int value whose byte representation is the given 4 bytes, in big-endian
order; equivalent to Ints.fromByteArray(new byte[] {b1, b2, b3, b4}). |
UnsignedInteger |
UnsignedInteger.times(UnsignedInteger val)
Returns the result of multiplying this and
val. |
static byte[] |
Chars.toByteArray(char value)
Returns a big-endian representation of
value in a 2-element byte array; equivalent to
ByteBuffer.allocate(2).putChar(value).array(). |
static byte[] |
Ints.toByteArray(int value)
Returns a big-endian representation of
value in a 4-element byte array; equivalent to
ByteBuffer.allocate(4).putInt(value).array(). |
static byte[] |
Shorts.toByteArray(short value)
Returns a big-endian representation of
value in a 2-element byte array; equivalent to
ByteBuffer.allocate(2).putShort(value).array(). |
static java.lang.Double |
Doubles.tryParse(java.lang.String string)
Parses the specified string as a double-precision floating point value.
|
static java.lang.Float |
Floats.tryParse(java.lang.String string)
Parses the specified string as a single-precision floating point value.
|
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractPackageSanityTests
Automatically runs sanity checks against top level classes in the same package of the test that
extends
AbstractPackageSanityTests. |
class |
ArbitraryInstances
Supplies an arbitrary "default" instance for a wide range of types, often useful in testing
utilities.
|
class |
ClassSanityTester
Tester that runs automated sanity tests for any given class.
|
(package private) class |
DummyProxy
Generates a dummy interface proxy that simply returns a dummy value for each method.
|
class |
ForwardingWrapperTester
Tester to ensure forwarding wrapper works by delegating calls to the corresponding method
with the same parameters forwarded and return value forwarded back or exception propagated as is.
|
(package private) class |
FreshValueGenerator
Generates fresh instances of types that are different from each other (if possible).
|
class |
GcFinalization
Testing utilities relating to garbage collection finalization.
|
class |
NullPointerTester
A test utility that verifies that your methods and constructors throw
NullPointerException or UnsupportedOperationException whenever null
is passed to a parameter that isn't annotated with Nullable. |
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractCheckedFuture<V,X extends java.lang.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 ListenableFuture
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. |
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. |
class |
AtomicDouble
A
double value that may be updated atomically. |
class |
AtomicDoubleArray
A
double array in which elements may be updated atomically. |
class |
Atomics
Static utility methods pertaining to classes in the
java.util.concurrent.atomic package. |
class |
CycleDetectingLockFactory
The
CycleDetectingLockFactory creates ReentrantLock instances and
ReentrantReadWriteLock instances that detect potential deadlock by checking for cycles in
lock acquisition order. |
class |
ExecutionList
A support class for
ListenableFuture implementations to manage their listeners. |
class |
FakeTimeLimiter
A TimeLimiter implementation which actually does not attempt to limit time at all.
|
class |
ForwardingBlockingQueue<E>
A
BlockingQueue which forwards all its method calls to another BlockingQueue. |
class |
ForwardingCheckedFuture<V,X extends java.lang.Exception>
A future which forwards all its method calls to another future.
|
class |
ForwardingExecutorService
An executor service which forwards all its method calls to another executor service.
|
class |
ForwardingFuture<V>
A
Future which forwards all its method calls to another future. |
class |
ForwardingListenableFuture<V>
A
ListenableFuture which forwards all its method calls to another future. |
class |
ForwardingListeningExecutorService
A listening executor service which forwards all its method calls to another listening executor
service.
|
private static class |
Futures.MappingCheckedFuture<V,X extends java.lang.Exception>
A checked future that uses a function to map from exceptions to the appropriate checked type.
|
(package private) class |
FuturesGetChecked
Static methods used to implement
Futures.getChecked(Future, Class). |
(package private) static class |
ImmediateFuture.ImmediateFailedCheckedFuture<V,X extends java.lang.Exception> |
(package private) static class |
ImmediateFuture.ImmediateSuccessfulCheckedFuture<V,X extends java.lang.Exception> |
class |
JdkFutureAdapters
Utilities necessary for working with libraries that supply plain
Future instances. |
class |
ListenableFutureTask<V>
A
FutureTask that also implements the ListenableFuture interface. |
interface |
ListenableScheduledFuture<V>
Helper interface to implement both
ListenableFuture and ScheduledFuture. |
(package private) class |
ListenerCallQueue<L>
A special purpose queue/executor that executes listener callbacks serially on a configured
executor.
|
interface |
ListeningExecutorService
An
ExecutorService that returns ListenableFuture instances. |
interface |
ListeningScheduledExecutorService
A
ScheduledExecutorService that returns ListenableFuture instances from its
ExecutorService methods. |
class |
Monitor
A synchronization abstraction supporting waiting on arbitrary boolean conditions.
|
(package private) static class |
MoreExecutors.Application
Represents the current application to register shutdown hooks.
|
private static class |
MoreExecutors.DirectExecutorService |
private static class |
MoreExecutors.ListeningDecorator |
private static class |
MoreExecutors.ScheduledListeningDecorator |
private static class |
MoreExecutors.ScheduledListeningDecorator.NeverSuccessfulListenableFutureTask |
class |
RateLimiter
A rate limiter.
|
(package private) class |
SerializingExecutor
Executor ensuring that all Runnables submitted are executed in order, using the provided
Executor, and serially such that no two will ever be running at the same time.
|
interface |
Service
An object with an operational state, plus asynchronous
Service.startAsync() and
Service.stopAsync() lifecycle methods to transition between states. |
class |
ServiceManager
A manager for monitoring and controlling a set of services.
|
class |
SimpleTimeLimiter
A TimeLimiter that runs method calls in the background using an
ExecutorService. |
(package private) class |
SmoothRateLimiter |
class |
Striped<L>
A striped
Lock/Semaphore/ReadWriteLock. |
class |
ThreadFactoryBuilder
A ThreadFactory builder, providing any combination of these features:
whether threads should be marked as daemon threads
a naming format
a thread priority
an uncaught exception handler
a backing thread factory
|
interface |
TimeLimiter
Produces proxies that impose a time limit on method calls to the proxied object.
|
(package private) class |
TimeoutFuture<V>
Implementation of
Futures#withTimeout. |
class |
UncaughtExceptionHandlers
Factories for
Thread.UncaughtExceptionHandler instances. |
class |
UncheckedTimeoutException
Unchecked version of
TimeoutException. |
(package private) class |
WrappingExecutorService
An abstract
ExecutorService that allows subclasses to wrap tasks before they are submitted to the underlying executor. |
(package private) class |
WrappingScheduledExecutorService
An abstract
ScheduledExecutorService that allows subclasses to
wrap tasks before they are submitted to the underlying executor. |
| Modifier and Type | Method and Description |
|---|---|
static void |
MoreExecutors.addDelayedShutdownHook(java.util.concurrent.ExecutorService service,
long terminationTimeout,
java.util.concurrent.TimeUnit timeUnit)
Add a shutdown hook to wait for thread completion in the given
service. |
static <T> AsyncCallable<T> |
Callables.asAsyncCallable(java.util.concurrent.Callable<T> callable,
ListeningExecutorService listeningExecutorService)
Creates an
AsyncCallable from a Callable. |
static void |
Uninterruptibles.awaitUninterruptibly(java.util.concurrent.CountDownLatch latch)
Invokes
latch.await() uninterruptibly. |
static boolean |
Uninterruptibles.awaitUninterruptibly(java.util.concurrent.CountDownLatch latch,
long timeout,
java.util.concurrent.TimeUnit unit)
Invokes
latch.await(timeout, unit)
uninterruptibly. |
static <V,X extends java.lang.Exception> |
Futures.getChecked(java.util.concurrent.Future<V> future,
java.lang.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 java.lang.Exception> |
Futures.getChecked(java.util.concurrent.Future<V> future,
java.lang.Class<X> exceptionClass,
long timeout,
java.util.concurrent.TimeUnit unit)
Returns the result of
Future.get(long, TimeUnit), converting most exceptions to a new
instance of the given checked exception type. |
static java.util.concurrent.ExecutorService |
MoreExecutors.getExitingExecutorService(java.util.concurrent.ThreadPoolExecutor executor)
Converts the given ThreadPoolExecutor into an ExecutorService that exits when the application
is complete.
|
static java.util.concurrent.ExecutorService |
MoreExecutors.getExitingExecutorService(java.util.concurrent.ThreadPoolExecutor executor,
long terminationTimeout,
java.util.concurrent.TimeUnit timeUnit)
Converts the given ThreadPoolExecutor into an ExecutorService that exits when the application
is complete.
|
static java.util.concurrent.ScheduledExecutorService |
MoreExecutors.getExitingScheduledExecutorService(java.util.concurrent.ScheduledThreadPoolExecutor executor)
Converts the given ScheduledThreadPoolExecutor into a ScheduledExecutorService that exits when
the application is complete.
|
static java.util.concurrent.ScheduledExecutorService |
MoreExecutors.getExitingScheduledExecutorService(java.util.concurrent.ScheduledThreadPoolExecutor executor,
long terminationTimeout,
java.util.concurrent.TimeUnit timeUnit)
Converts the given ScheduledThreadPoolExecutor into a ScheduledExecutorService that exits when
the application is complete.
|
static <V> V |
Futures.getUnchecked(java.util.concurrent.Future<V> future)
Returns the result of calling
Future.get() uninterruptibly on a task known not to throw
a checked exception. |
static <V> V |
Uninterruptibles.getUninterruptibly(java.util.concurrent.Future<V> future,
long timeout,
java.util.concurrent.TimeUnit unit)
Invokes
future.get(timeout, unit) uninterruptibly. |
static <V,X extends java.lang.Exception> |
Futures.immediateCheckedFuture(V value)
Returns a
CheckedFuture which has its value set immediately upon construction. |
static <V,X extends java.lang.Exception> |
Futures.immediateFailedCheckedFuture(X exception)
Returns a
CheckedFuture which has an exception set immediately upon construction. |
static <T> ImmutableList<ListenableFuture<T>> |
Futures.inCompletionOrder(java.lang.Iterable<? extends ListenableFuture<? extends T>> futures)
Returns a list of delegate futures that correspond to the futures received in the order that
they complete.
|
(package private) static <T> T |
MoreExecutors.invokeAnyImpl(ListeningExecutorService executorService,
java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
boolean timed,
long timeout,
java.util.concurrent.TimeUnit unit)
An implementation of
ExecutorService.invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>>) for ListeningExecutorService
implementations. |
private static boolean |
MoreExecutors.isAppEngine() |
static void |
Uninterruptibles.joinUninterruptibly(java.lang.Thread toJoin)
Invokes
toJoin.join() uninterruptibly. |
static void |
Uninterruptibles.joinUninterruptibly(java.lang.Thread toJoin,
long timeout,
java.util.concurrent.TimeUnit unit)
Invokes
unit.timedJoin(toJoin, timeout)
uninterruptibly. |
static <I,O> java.util.concurrent.Future<O> |
Futures.lazyTransform(java.util.concurrent.Future<I> input,
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 ListeningExecutorService |
MoreExecutors.listeningDecorator(java.util.concurrent.ExecutorService delegate)
Creates an
ExecutorService whose submit and invokeAll methods submit ListenableFutureTask instances to the given delegate
executor. |
static ListeningScheduledExecutorService |
MoreExecutors.listeningDecorator(java.util.concurrent.ScheduledExecutorService delegate)
Creates a
ScheduledExecutorService whose submit and invokeAll methods
submit ListenableFutureTask instances to the given delegate executor. |
static <V,X extends java.lang.Exception> |
Futures.makeChecked(ListenableFuture<V> future,
Function<? super java.lang.Exception,X> mapper)
Creates a
CheckedFuture out of a normal ListenableFuture and a Function
that maps from Exception instances into the appropriate checked type. |
static ListeningExecutorService |
MoreExecutors.newDirectExecutorService()
Creates an executor service that runs each task in the thread that invokes
execute/submit, as in ThreadPoolExecutor.CallerRunsPolicy This applies both to individually
submitted tasks and to collections of tasks submitted via invokeAll or
invokeAny. |
(package private) static java.lang.Thread |
MoreExecutors.newThread(java.lang.String name,
java.lang.Runnable runnable)
Creates a thread using
MoreExecutors.platformThreadFactory(), and sets its name to name unless
changing the name is forbidden by the security manager. |
static java.util.concurrent.ThreadFactory |
MoreExecutors.platformThreadFactory()
Returns a default thread factory used to create new threads.
|
static <E> void |
Uninterruptibles.putUninterruptibly(java.util.concurrent.BlockingQueue<E> queue,
E element)
Invokes
queue.put(element) uninterruptibly. |
(package private) static java.util.concurrent.ExecutorService |
MoreExecutors.renamingDecorator(java.util.concurrent.ExecutorService service,
Supplier<java.lang.String> nameSupplier)
Creates an
ExecutorService that renames the threads that its tasks run
in. |
(package private) static java.util.concurrent.Executor |
MoreExecutors.renamingDecorator(java.util.concurrent.Executor executor,
Supplier<java.lang.String> nameSupplier)
Creates an
Executor that renames the threads that its tasks run in. |
(package private) static java.util.concurrent.ScheduledExecutorService |
MoreExecutors.renamingDecorator(java.util.concurrent.ScheduledExecutorService service,
Supplier<java.lang.String> nameSupplier)
Creates a
ScheduledExecutorService that renames the threads that its
tasks run in. |
static ListeningExecutorService |
MoreExecutors.sameThreadExecutor()
Deprecated.
Use
MoreExecutors.directExecutor() if you only require an Executor and
MoreExecutors.newDirectExecutorService() if you need a ListeningExecutorService. This
method will be removed in Guava 21.0. |
static boolean |
MoreExecutors.shutdownAndAwaitTermination(java.util.concurrent.ExecutorService service,
long timeout,
java.util.concurrent.TimeUnit unit)
Shuts down the given executor service gradually, first disabling new submissions and later, if
necessary, cancelling remaining tasks.
|
static void |
Uninterruptibles.sleepUninterruptibly(long sleepFor,
java.util.concurrent.TimeUnit unit)
Invokes
unit.sleep(sleepFor) uninterruptibly. |
private static <T> ListenableFuture<T> |
MoreExecutors.submitAndAddQueueListener(ListeningExecutorService executorService,
java.util.concurrent.Callable<T> task,
java.util.concurrent.BlockingQueue<java.util.concurrent.Future<T>> queue)
Submits the task and adds a listener that adds the future to
queue when it completes. |
static <E> E |
Uninterruptibles.takeUninterruptibly(java.util.concurrent.BlockingQueue<E> queue)
Invokes
queue.take() uninterruptibly. |
(package private) static <T> java.util.concurrent.Callable<T> |
Callables.threadRenaming(java.util.concurrent.Callable<T> callable,
Supplier<java.lang.String> nameSupplier)
Wraps the given callable such that for the duration of
Callable.call() the thread that is
running will have the given name. |
(package private) static java.lang.Runnable |
Callables.threadRenaming(java.lang.Runnable task,
Supplier<java.lang.String> nameSupplier)
Wraps the given runnable such that for the duration of
Runnable.run() the thread that is
running with have the given name. |
static boolean |
Uninterruptibles.tryAcquireUninterruptibly(java.util.concurrent.Semaphore semaphore,
int permits,
long timeout,
java.util.concurrent.TimeUnit unit)
Invokes
semaphore.tryAcquire(permits,
timeout, unit) uninterruptibly. |
static boolean |
Uninterruptibles.tryAcquireUninterruptibly(java.util.concurrent.Semaphore semaphore,
long timeout,
java.util.concurrent.TimeUnit unit)
Invokes
semaphore.tryAcquire(1,
timeout, unit) uninterruptibly. |
private static boolean |
Callables.trySetName(java.lang.String threadName,
java.lang.Thread currentThread)
Tries to set name of the given
Thread, returns true if successful. |
private static void |
MoreExecutors.useDaemonThreadFactory(java.util.concurrent.ThreadPoolExecutor executor) |
static <V> ListenableFuture<V> |
Futures.withTimeout(ListenableFuture<V> delegate,
long time,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.ScheduledExecutorService scheduledExecutor)
Returns a future that delegates to another but will finish early (via a
TimeoutException wrapped in an ExecutionException) if the specified duration expires. |
private static void |
Futures.wrapAndThrowUnchecked(java.lang.Throwable cause) |
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractCheckedFutureTest
Test case to make sure the
CheckedFuture.checkedGet() and
CheckedFuture.checkedGet(long, TimeUnit) methods work correctly. |
class |
AbstractListenableFutureTest
Abstract test case parent for anything implementing
ListenableFuture. |
class |
MockFutureListener
A simple mock implementation of
Runnable that can be used for
testing ListenableFutures. |
(package private) class |
SameThreadScheduledExecutorService
A ScheduledExecutorService that executes all scheduled actions immediately
in the calling thread.
|
class |
TestingExecutors
Factory methods for
ExecutorService for testing. |