| 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.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  BigIntegerinstances. | 
| com.google.common.primitives | Static utilities for working with the eight primitive types and  void,
 and value types for treating them as unsigned. | 
| Modifier and Type | Class and Description | 
|---|---|
| class  | StandardSystemPropertyRepresents a standard system property. | 
| Modifier and Type | Field and Description | 
|---|---|
| static Charset | Charsets. ISO_8859_1ISO-8859-1: ISO Latin Alphabet Number 1 (ISO-LATIN-1). | 
| static Charset | Charsets. US_ASCIIUS-ASCII: seven-bit ASCII, the Basic Latin block of the Unicode character set (ISO646-US). | 
| static Charset | Charsets. UTF_16UTF-16: sixteen-bit UCS Transformation Format, byte order identified by an optional byte-order
 mark. | 
| static Charset | Charsets. UTF_16BEUTF-16BE: sixteen-bit UCS Transformation Format, big-endian byte order. | 
| static Charset | Charsets. UTF_16LEUTF-16LE: sixteen-bit UCS Transformation Format, little-endian byte order. | 
| Modifier and Type | Method and Description | 
|---|---|
| static Predicate<Class<?>> | Predicates. assignableFrom(Class<?> clazz)Returns a predicate that evaluates to  trueif the class being
 tested is assignable from the given class. | 
| static Predicate<CharSequence> | Predicates. contains(Pattern pattern)Returns a predicate that evaluates to  trueif theCharSequencebeing tested contains any match for the given
 regular expression pattern. | 
| static Predicate<CharSequence> | Predicates. containsPattern(String pattern)Returns a predicate that evaluates to  trueif theCharSequencebeing tested contains any match for the given
 regular expression pattern. | 
| static Field | Enums. getField(Enum<?> enumValue)Returns the  Fieldin whichenumValueis defined. | 
| static Predicate<Object> | Predicates. instanceOf(Class<?> clazz)Returns a predicate that evaluates to  trueif the object being
 tested is an instance of the given class. | 
| static Splitter | Splitter. on(Pattern separatorPattern)Returns a splitter that considers any subsequence matching  patternto be a separator. | 
| static Splitter | Splitter. onPattern(String separatorPattern)Returns a splitter that considers any subsequence matching a given
 pattern (regular expression) to be a separator. | 
| String | Stopwatch. toString()Returns a string representation of the current elapsed time. | 
| Modifier and Type | Method and Description | 
|---|---|
| static <K,V> CacheLoader<K,V> | CacheLoader. asyncReloading(CacheLoader<K,V> loader,
                            Executor executor)Returns a  CacheLoaderwhich wrapsloader, executing calls toCacheLoader.reload(K, V)usingexecutor. | 
| static CacheBuilder<Object,Object> | CacheBuilder. from(CacheBuilderSpec spec)Constructs a new  CacheBuilderinstance with the settings specified inspec. | 
| static CacheBuilder<Object,Object> | CacheBuilder. from(String spec)Constructs a new  CacheBuilderinstance with the settings specified inspec. | 
| CacheBuilder<K,V> | CacheBuilder. maximumWeight(long weight)Specifies the maximum weight of entries the cache may contain. | 
| 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. | 
| 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). | 
| 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 | 
|---|---|
| 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. | 
| class  | ImmutableRangeMap<K extends Comparable<?>,V>An immutable implementation of  RangeMap, supporting all query operations efficiently. | 
| class  | ImmutableSortedMultiset<E>An immutable  SortedMultisetthat stores its elements in a sorted array. | 
| class  | TreeRangeMap<K extends Comparable,V>An implementation of  RangeMapbased on aTreeMap, supporting
 all optional operations. | 
| class  | TreeRangeSet<C extends Comparable<?>> | 
| Modifier and Type | Method and Description | 
|---|---|
| NavigableMap<K,Collection<V>> | TreeMultimap. asMap()Returns a map view that associates each key with the corresponding values
 in the multimap. | 
| 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. | 
| E | ImmutableSortedSet. ceiling(E e) | 
| static <T> T[] | ObjectArrays. concat(T[] first,
            T[] second,
            Class<T> type)Returns a new array that contains the concatenated contents of two arrays. | 
| abstract UnmodifiableIterator<E> | ImmutableSortedSet. descendingIterator() | 
| ImmutableSortedSet<E> | ImmutableSortedSet. descendingSet() | 
| <T> FluentIterable<T> | FluentIterable. filter(Class<T> type)Returns the elements from this fluent iterable that are instances of class  type. | 
| static <T> Iterable<T> | Iterables. filter(Iterable<?> unfiltered,
            Class<T> type)Returns all instances of class  typeinunfiltered. | 
| static <T> UnmodifiableIterator<T> | Iterators. filter(Iterator<?> unfiltered,
            Class<T> type)Returns all instances of class  typeinunfiltered. | 
| static <E> NavigableSet<E> | Sets. filter(NavigableSet<E> unfiltered,
            Predicate<? super E> predicate)Returns the elements of a  NavigableSet,unfiltered, that
 satisfy a predicate. | 
| static <K,V> NavigableMap<K,V> | Maps. filterEntries(NavigableMap<K,V> unfiltered,
                          Predicate<? super Map.Entry<K,V>> entryPredicate)Returns a sorted map containing the mappings in  unfilteredthat
 satisfy a predicate. | 
| static <K,V> NavigableMap<K,V> | Maps. filterKeys(NavigableMap<K,V> unfiltered,
                    Predicate<? super K> keyPredicate)Returns a navigable map containing the mappings in  unfilteredwhose
 keys satisfy a predicate. | 
| static <K,V> NavigableMap<K,V> | Maps. filterValues(NavigableMap<K,V> unfiltered,
                        Predicate<? super V> valuePredicate)Returns a navigable map containing the mappings in  unfilteredwhose
 values satisfy a predicate. | 
| E | ImmutableSortedSet. floor(E e) | 
| static ImmutableMap<String,String> | Maps. fromProperties(Properties properties)Creates an  ImmutableMap<String, String>from aPropertiesinstance. | 
| 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) | 
| NavigableSet<K> | TreeMultimap. keySet()Returns a view collection of all distinct keys contained in this
 multimap. | 
| E | ImmutableSortedSet. lower(E e) | 
| static <T> T[] | ObjectArrays. newArray(Class<T> type,
                int length)Returns a new array of the given length with the specified component type. | 
| static <E> CopyOnWriteArrayList<E> | Lists. newCopyOnWriteArrayList()Creates an empty  CopyOnWriteArrayListinstance. | 
| static <E> CopyOnWriteArrayList<E> | Lists. newCopyOnWriteArrayList(Iterable<? extends E> elements)Creates a  CopyOnWriteArrayListinstance containing the given elements. | 
| static <E> CopyOnWriteArraySet<E> | Sets. newCopyOnWriteArraySet()Creates an empty  CopyOnWriteArraySetinstance. | 
| static <E> CopyOnWriteArraySet<E> | Sets. newCopyOnWriteArraySet(Iterable<? extends E> elements)Creates a  CopyOnWriteArraySetinstance containing the given elements. | 
| 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. | 
| E | ImmutableSortedSet. pollFirst()Deprecated. 
 Unsupported operation. | 
| E | ImmutableSortedSet. pollLast()Deprecated. 
 Unsupported operation. | 
| MapMaker | MapMaker. softValues()Deprecated. 
 Caching functionality in  MapMakerhas been moved toCacheBuilder, withMapMaker.softValues()being replaced byCacheBuilder.softValues(). Note thatCacheBuilderis simply
     an enhanced API for an implementation which was branched fromMapMaker. This
     method is scheduled for deletion in September 2014. | 
| 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,V> NavigableMap<K,V> | Maps. synchronizedNavigableMap(NavigableMap<K,V> navigableMap)Returns a synchronized (thread-safe) navigable map backed by the specified
 navigable map. | 
| static <E> NavigableSet<E> | Sets. synchronizedNavigableSet(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(Class<E> type)Returns an array containing all of the elements from this fluent iterable in iteration order. | 
| V[][] | ArrayTable. toArray(Class<V> valueClass)Returns a two-dimensional array with the table contents. | 
| static <T> T[] | Iterables. toArray(Iterable<? extends T> iterable,
              Class<T> type)Copies an iterable's elements into an array. | 
| static <T> T[] | Iterators. toArray(Iterator<? extends T> iterator,
              Class<T> type)Copies an iterator's elements into an array. | 
| static <K,V1,V2> NavigableMap<K,V2> | Maps. transformEntries(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> NavigableMap<K,V2> | Maps. transformValues(NavigableMap<K,V1> fromMap,
                              Function<? super V1,V2> function)Returns a view of a navigable map where each value is transformed by a
 function. | 
| static <K,V> NavigableMap<K,V> | Maps. unmodifiableNavigableMap(NavigableMap<K,V> map)Returns an unmodifiable view of the specified navigable map. | 
| static <E> NavigableSet<E> | Sets. unmodifiableNavigableSet(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). | 
| Modifier and Type | Method and Description | 
|---|---|
| ByteSource | BaseEncoding. decodingSource(CharSource encodedSource)Returns a  ByteSourcethat reads base-encoded bytes from the specifiedCharSource. | 
| InputStream | BaseEncoding. decodingStream(Reader reader)Returns an  InputStreamthat decodes base-encoded input from the specifiedReader. | 
| ByteSink | BaseEncoding. encodingSink(CharSink encodedSink)Returns a  ByteSinkthat writes base-encoded bytes to the specifiedCharSink. | 
| OutputStream | BaseEncoding. encodingStream(Writer writer)Returns an  OutputStreamthat encodes bytes using this encoding into the specifiedWriter. | 
| Modifier and Type | Method and Description | 
|---|---|
| static int | IntMath. binomial(int n,
                int k)Returns  nchoosek, also known as the binomial coefficient ofnandk, orInteger.MAX_VALUEif the result does not fit in anint. | 
| static long | LongMath. checkedAdd(long a,
                    long b)Returns the sum of  aandb, provided it does not overflow. | 
| static long | LongMath. checkedMultiply(long a,
                              long b)Returns the product of  aandb, provided it does not overflow. | 
| static long | LongMath. checkedPow(long b,
                    int k)Returns the  bto thekth power, provided it does not overflow. | 
| static long | LongMath. checkedSubtract(long a,
                              long b)Returns the difference of  aandb, provided it does not overflow. | 
| static BigInteger | BigIntegerMath. divide(BigInteger p,
            BigInteger q,
            RoundingMode mode)Returns the result of dividing  pbyq, rounding using the specifiedRoundingMode. | 
| static long | LongMath. divide(long p,
            long q,
            RoundingMode mode)Returns the result of dividing  pbyq, rounding using the specifiedRoundingMode. | 
| static long | LongMath. factorial(int n)Returns  n!, that is, the product of the firstnpositive
 integers,1ifn == 0, orLong.MAX_VALUEif the
 result does not fit in along. | 
| static boolean | DoubleMath. isMathematicalInteger(double x)Returns  trueifxrepresents a mathematical integer. | 
| static boolean | DoubleMath. isPowerOfTwo(double x)Returns  trueifxis exactly equal to2^kfor some finite integerk. | 
| static int | BigIntegerMath. log10(BigInteger x,
          RoundingMode mode)Returns the base-10 logarithm of  x, rounded according to the specified rounding mode. | 
| static int | IntMath. log10(int x,
          RoundingMode mode)Returns the base-10 logarithm of  x, rounded according to the specified rounding mode. | 
| static int | LongMath. log10(long x,
          RoundingMode mode)Returns the base-10 logarithm of  x, rounded according to the specified rounding mode. | 
| static int | DoubleMath. log2(double x,
        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)Returns the arithmetic mean of the values. | 
| static double | DoubleMath. mean(int... values)Returns the arithmetic mean of the values. | 
| static double | DoubleMath. mean(Iterable<? extends Number> values)Returns the arithmetic mean of the values. | 
| static double | DoubleMath. mean(Iterator<? extends Number> values)Returns the arithmetic mean of the values. | 
| static double | DoubleMath. mean(long... values)Returns the arithmetic mean of the values. | 
| static int | LongMath. mod(long x,
      int m)Returns  x mod m, a non-negative value less thanm. | 
| static long | LongMath. mod(long x,
      long m)Returns  x mod m, a non-negative value less thanm. | 
| static int | IntMath. pow(int b,
      int k)Returns  bto thekth power. | 
| static long | LongMath. pow(long b,
      int k)Returns  bto thekth power. | 
| static BigInteger | DoubleMath. roundToBigInteger(double x,
                                  RoundingMode mode)Returns the  BigIntegervalue that is equal toxrounded with the specified
 rounding mode, if possible. | 
| static int | DoubleMath. roundToInt(double x,
                    RoundingMode mode)Returns the  intvalue that is equal toxrounded with the specified rounding
 mode, if possible. | 
| static long | DoubleMath. roundToLong(double x,
                      RoundingMode mode)Returns the  longvalue that is equal toxrounded with the specified rounding
 mode, if possible. | 
| static BigInteger | BigIntegerMath. sqrt(BigInteger x,
        RoundingMode mode)Returns the square root of  x, rounded with the specified rounding mode. | 
| static int | IntMath. sqrt(int x,
        RoundingMode mode)Returns the square root of  x, rounded with the specified rounding mode. | 
| static long | LongMath. sqrt(long x,
        RoundingMode mode)Returns the square root of  x, rounded with the specified rounding mode. | 
| Modifier and Type | Method and Description | 
|---|---|
| static int | Ints. fromByteArray(byte[] bytes)Returns the  intvalue whose big-endian representation is stored in
 the first 4 bytes ofbytes; equivalent toByteBuffer.wrap(bytes).getInt(). | 
| static char | Chars. fromByteArray(byte[] bytes)Returns the  charvalue whose big-endian representation is
 stored in the first 2 bytes ofbytes; equivalent toByteBuffer.wrap(bytes).getChar(). | 
| static short | Shorts. fromByteArray(byte[] bytes)Returns the  shortvalue whose big-endian representation is
 stored in the first 2 bytes ofbytes; equivalent toByteBuffer.wrap(bytes).getShort(). | 
| static char | Chars. fromBytes(byte b1,
                  byte b2)Returns the  charvalue whose byte representation is the given 2
 bytes, in big-endian order; equivalent toChars.fromByteArray(new
 byte[] {b1, b2}). | 
| static short | Shorts. fromBytes(byte b1,
                  byte b2)Returns the  shortvalue whose byte representation is the given 2
 bytes, in big-endian order; equivalent toShorts.fromByteArray(new
 byte[] {b1, b2}). | 
| static int | Ints. fromBytes(byte b1,
                  byte b2,
                  byte b3,
                  byte b4)Returns the  intvalue whose byte representation is the given 4
 bytes, in big-endian order; equivalent toInts.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  valuein a 2-element byte
 array; equivalent toByteBuffer.allocate(2).putChar(value).array(). | 
| static byte[] | Ints. toByteArray(int value)Returns a big-endian representation of  valuein a 4-element byte
 array; equivalent toByteBuffer.allocate(4).putInt(value).array(). | 
| static byte[] | Shorts. toByteArray(short value)Returns a big-endian representation of  valuein a 2-element byte
 array; equivalent toByteBuffer.allocate(2).putShort(value).array(). | 
| static Integer | Ints. tryParse(String string)Parses the specified string as a signed decimal integer value. | 
| static Float | Floats. tryParse(String string)Parses the specified string as a single-precision floating point value. | 
| static Double | Doubles. tryParse(String string)Parses the specified string as a double-precision floating point value. | 
Copyright © 2010-2014. All Rights Reserved.