Package | Description |
---|---|
com.google.common.base |
Basic utility libraries and interfaces.
|
com.google.common.collect |
This package contains generic collection interfaces and implementations, and
other utilities for working with collections.
|
com.google.common.primitives |
Static utilities for working with the eight primitive types and
void . |
Modifier and Type | Method and Description |
---|---|
static Predicate<CharSequence> |
Predicates.contains(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<CharSequence> |
Predicates.containsPattern(String pattern)
Returns a predicate that evaluates to
true if the
CharSequence being tested contains any match for the given
regular expression pattern. |
static Predicate<Object> |
Predicates.instanceOf(Class<?> clazz)
Returns a predicate that evaluates to
true if 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
pattern to 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.
|
Modifier and Type | Method and Description |
---|---|
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 GenericMapMaker<K0,V0> |
GenericMapMaker.concurrencyLevel(int concurrencyLevel)
|
MapMaker |
MapMaker.concurrencyLevel(int concurrencyLevel)
Guides the allowed concurrency among update operations.
|
<K,V> GenericMapMaker<K,V> |
MapMaker.evictionListener(MapEvictionListener<K,V> listener)
Specifies a listener instance, which all maps built using this
MapMaker will notify each time an entry is evicted. |
abstract GenericMapMaker<K0,V0> |
GenericMapMaker.expireAfterAccess(long duration,
TimeUnit unit)
|
MapMaker |
MapMaker.expireAfterAccess(long duration,
TimeUnit unit)
Specifies that each entry should be automatically removed from the
map once a fixed duration has passed since the entry's last read or
write access.
|
static <T> Iterable<T> |
Iterables.filter(Iterable<?> unfiltered,
Class<T> type)
Returns all instances of class
type in unfiltered . |
static <T> UnmodifiableIterator<T> |
Iterators.filter(Iterator<?> unfiltered,
Class<T> type)
Returns all instances of class
type in unfiltered . |
static <K,V> SortedMap<K,V> |
SortedMaps.filterEntries(SortedMap<K,V> unfiltered,
Predicate<? super Map.Entry<K,V>> entryPredicate)
Returns a sorted map containing the mappings in
unfiltered that
satisfy a predicate. |
static <K,V> SortedMap<K,V> |
SortedMaps.filterKeys(SortedMap<K,V> unfiltered,
Predicate<? super K> keyPredicate)
Returns a sorted map containing the mappings in
unfiltered whose
keys satisfy a predicate. |
static <K,V> SortedMap<K,V> |
SortedMaps.filterValues(SortedMap<K,V> unfiltered,
Predicate<? super V> valuePredicate)
Returns a sorted map containing the mappings in
unfiltered whose
values satisfy a predicate. |
static ImmutableMap<String,String> |
Maps.fromProperties(Properties properties)
Creates an
ImmutableMap<String, String> from a Properties
instance. |
static <T> T[] |
ObjectArrays.newArray(Class<T> type,
int length)
Returns a new array of the given length with the specified component type.
|
abstract GenericMapMaker<K0,V0> |
GenericMapMaker.softKeys()
See
MapMaker.softKeys() . |
MapMaker |
MapMaker.softKeys()
Specifies that each key (not value) stored in the map should be
wrapped in a
SoftReference (by default, strong references
are used). |
abstract GenericMapMaker<K0,V0> |
GenericMapMaker.softValues()
|
MapMaker |
MapMaker.softValues()
Specifies that each value (not key) stored in the map should be
wrapped in a
SoftReference (by default, strong references
are used). |
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> ListMultimap<K,V2> |
Multimaps.transformEntries(ListMultimap<K,V1> fromMap,
Maps.EntryTransformer<? super K,? super V1,V2> transformer)
Returns a view of a
ListMultimap whose values are derived from the
original multimap's entries. |
static <K,V1,V2> Multimap<K,V2> |
Multimaps.transformEntries(Multimap<K,V1> fromMap,
Maps.EntryTransformer<? super K,? super V1,V2> transformer)
Returns a view of a multimap whose values are derived from the original
multimap's entries.
|
static <K,V1,V2> ListMultimap<K,V2> |
Multimaps.transformValues(ListMultimap<K,V1> fromMultimap,
Function<? super V1,V2> function)
Returns a view of a
ListMultimap where each value is transformed by
a function. |
static <K,V1,V2> Multimap<K,V2> |
Multimaps.transformValues(Multimap<K,V1> fromMultimap,
Function<? super V1,V2> function)
Returns a view of a multimap where each value is transformed by a function.
|
abstract GenericMapMaker<K0,V0> |
GenericMapMaker.weakKeys()
See
MapMaker.weakKeys() . |
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). |
abstract GenericMapMaker<K0,V0> |
GenericMapMaker.weakValues()
|
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 |
---|---|
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 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 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 long |
Longs.fromByteArray(byte[] bytes)
Returns the
long value whose big-endian representation is
stored in the first 8 bytes of bytes ; equivalent to ByteBuffer.wrap(bytes).getLong() . |
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}) . |
static long |
Longs.fromBytes(byte b1,
byte b2,
byte b3,
byte b4,
byte b5,
byte b6,
byte b7,
byte b8)
Returns the
long value whose byte representation is the given 8
bytes, in big-endian order; equivalent to Longs.fromByteArray(new
byte[] {b1, b2, b3, b4, b5, b6, b7, b8}) . |
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[] |
Longs.toByteArray(long value)
Returns a big-endian representation of
value in an 8-element byte
array; equivalent to ByteBuffer.allocate(8).putLong(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() . |
Copyright © 2010-2012. All Rights Reserved.