Class Platform
java.lang.Object
org.docx4j.com.google.common.collect.Platform
Methods factored out so that they can be emulated differently in GWT.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static <T> T[]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 <K,V> Map<K, V> newHashMapWithExpectedSize(int expectedSize) Returns the platform preferred implementation of a map based on a hash table.(package private) static <E> Set<E>newHashSetWithExpectedSize(int expectedSize) Returns the platform preferred implementation of a set based on a hash table.(package private) static <K,V> 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> Set<E>newLinkedHashSetWithExpectedSize(int expectedSize) Returns the platform preferred implementation of an insertion ordered set based on a hash table.(package private) static <E> Set<E>Returns the platform preferred set implementation that preserves insertion order when used only for insertions.(package private) static <K,V> Map<K, V> Returns the platform preferred map implementation that preserves insertion order when used only for insertions.(package private) static intreduceExponentIfGwt(int exponent) (package private) static intreduceIterationsIfGwt(int iterations)
-
Constructor Details
-
Platform
private Platform()
-
-
Method Details
-
newHashMapWithExpectedSize
Returns the platform preferred implementation of a map based on a hash table. -
newLinkedHashMapWithExpectedSize
Returns the platform preferred implementation of an insertion ordered map based on a hash table. -
newHashSetWithExpectedSize
Returns the platform preferred implementation of a set based on a hash table. -
newLinkedHashSetWithExpectedSize
Returns the platform preferred implementation of an insertion ordered set based on a hash table. -
preservesInsertionOrderOnPutsMap
Returns the platform preferred map implementation that preserves insertion order when used only for insertions. -
preservesInsertionOrderOnAddsSet
Returns the platform preferred set implementation that preserves insertion order when used only for insertions. -
newArray
static <T> T[] newArray(T[] reference, int length) Returns a new array of the given length with the same type as a reference array.- Parameters:
reference- any array of the desired typelength- the length of the new array
-
copy
Equivalent to Arrays.copyOfRange(source, from, to, arrayOfType.getClass()). -
reduceIterationsIfGwt
static int reduceIterationsIfGwt(int iterations) -
reduceExponentIfGwt
static int reduceExponentIfGwt(int exponent)
-