public class MemoryReductionUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String[] |
EMPTY_STRING_ARRAY
Empty string array, exactly what it says on the tin.
|
Constructor and Description |
---|
MemoryReductionUtil() |
Modifier and Type | Method and Description |
---|---|
static Map |
getPresizedMutableMap(int elementCount)
Returns a mutable HashMap presized to hold the given number of elements without needing to resize.
|
static String[] |
internInPlace(String[] input)
Returns the input strings, but with all values interned.
|
static int |
preallocatedHashmapCapacity(int elementsToHold)
Returns the capacity we need to allocate for a HashMap so it will hold all elements without needing to resize.
|
public static final String[] EMPTY_STRING_ARRAY
public static int preallocatedHashmapCapacity(int elementsToHold)
public static Map getPresizedMutableMap(int elementCount)
Copyright © 2004–2021. All rights reserved.