final class Platform
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.logging.Logger |
logger |
Modifier | Constructor and Description |
---|---|
private |
Platform() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
checkGwtRpcEnabled() |
(package private) static <T> T[] |
copy(java.lang.Object[] source,
int from,
int to,
T[] arrayOfType)
Equivalent to Arrays.copyOfRange(source, from, to, arrayOfType.getClass()).
|
(package private) static <T> T[] |
newArray(T[] reference,
int length)
Returns a new array of the given length with the same type as a reference array.
|
(package private) static <E> java.util.Set<E> |
newConcurrentHashSet()
Returns the platform preferred implementation of a thread-safe hash set.
|
(package private) static <K,V> java.util.Map<K,V> |
newHashMapWithExpectedSize(int expectedSize)
Returns the platform preferred implementation of a map based on a hash table.
|
(package private) static <E> java.util.Set<E> |
newHashSetWithExpectedSize(int expectedSize)
Returns the platform preferred implementation of a set based on a hash table.
|
(package private) static <K,V> java.util.Map<K,V> |
newLinkedHashMapWithExpectedSize(int expectedSize)
Returns the platform preferred implementation of an insertion ordered map based on a hash
table.
|
(package private) static <E> java.util.Set<E> |
newLinkedHashSetWithExpectedSize(int expectedSize)
Returns the platform preferred implementation of an insertion ordered set based on a hash
table.
|
(package private) static <E> java.util.Set<E> |
preservesInsertionOrderOnAddsSet()
Returns the platform preferred set implementation that preserves insertion order when used only
for insertions.
|
(package private) static <K,V> java.util.Map<K,V> |
preservesInsertionOrderOnPutsMap()
Returns the platform preferred map implementation that preserves insertion order when used only
for insertions.
|
(package private) static int |
reduceExponentIfGwt(int exponent) |
(package private) static int |
reduceIterationsIfGwt(int iterations) |
(package private) static MapMaker |
tryWeakKeys(MapMaker mapMaker)
Configures the given map maker to use weak keys, if possible; does nothing otherwise (i.e., in
GWT).
|
static <K,V> java.util.Map<K,V> newHashMapWithExpectedSize(int expectedSize)
static <K,V> java.util.Map<K,V> newLinkedHashMapWithExpectedSize(int expectedSize)
static <E> java.util.Set<E> newHashSetWithExpectedSize(int expectedSize)
static <E> java.util.Set<E> newConcurrentHashSet()
static <E> java.util.Set<E> newLinkedHashSetWithExpectedSize(int expectedSize)
static <K,V> java.util.Map<K,V> preservesInsertionOrderOnPutsMap()
static <E> java.util.Set<E> preservesInsertionOrderOnAddsSet()
static <T> T[] newArray(T[] reference, int length)
reference
- any array of the desired typelength
- the length of the new arraystatic <T> T[] copy(java.lang.Object[] source, int from, int to, T[] arrayOfType)
static MapMaker tryWeakKeys(MapMaker mapMaker)
static int reduceIterationsIfGwt(int iterations)
static int reduceExponentIfGwt(int exponent)
static void checkGwtRpcEnabled()