Package one.microstream.memory.sun
Class SunJdk8Internals
- java.lang.Object
-
- one.microstream.memory.sun.SunJdk8Internals
-
public final class SunJdk8Internals extends Object
-
-
Constructor Summary
Constructors Constructor Description SunJdk8Internals()
-
Method Summary
Modifier and Type Method Description static Object[]
accessArray(ArrayList<?> arrayList)
static Object[]
accessArray(PriorityQueue<?> priorityQueue)
static Object[]
accessArray(Vector<?> vector)
static Properties
accessDefaults(Properties properties)
static boolean
getAccessOrder(LinkedHashMap<?,?> linkedHashMap)
static int
getCapacityIncrement(Vector<?> vector)
static int
getElementCount(Vector<?> vector)
static float
getLoadFactor(HashMap<?,?> hashMap)
static float
getLoadFactor(HashSet<?> hashSet)
My god.static float
getLoadFactor(Hashtable<?,?> hashtable)
static float
getLoadFactor(LinkedHashMap<?,?> linkedHashMap)
static void
setCapacityIncrement(Vector<?> vector, int size)
static void
setDefaults(Properties properties, Properties defaults)
static void
setElementCount(Vector<?> vector, int size)
static void
setSize(ArrayList<?> arrayList, int size)
static void
setSize(PriorityQueue<?> priorityQueue, int size)
-
-
-
Method Detail
-
setSize
public static void setSize(ArrayList<?> arrayList, int size)
-
getLoadFactor
public static float getLoadFactor(HashSet<?> hashSet)
My god. How incompetent can one be: they provide a constructor for configuring the load factor, but they provide no means to querying it. So if a hashset instance shall be transformed to another context and back (e.g. persistence), what is one supposed to do? Ignore the load factor and change the program behavior? What harm would it do to add an implementation-specific getter?Not to mention the set wraps a map internally which is THE most moronic thing to do both memory- and performance-wise.
So another hack method has to provide basic functionality that is missing in the JDK. And should they ever get the idea to implement the set properly, this method will break.
- Parameters:
hashSet
-
-
getLoadFactor
public static float getLoadFactor(HashMap<?,?> hashMap)
-
getLoadFactor
public static float getLoadFactor(Hashtable<?,?> hashtable)
-
getLoadFactor
public static float getLoadFactor(LinkedHashMap<?,?> linkedHashMap)
-
getAccessOrder
public static boolean getAccessOrder(LinkedHashMap<?,?> linkedHashMap)
-
getElementCount
public static int getElementCount(Vector<?> vector)
-
setElementCount
public static void setElementCount(Vector<?> vector, int size)
-
getCapacityIncrement
public static int getCapacityIncrement(Vector<?> vector)
-
setCapacityIncrement
public static void setCapacityIncrement(Vector<?> vector, int size)
-
accessDefaults
public static Properties accessDefaults(Properties properties)
-
setDefaults
public static void setDefaults(Properties properties, Properties defaults)
-
accessArray
public static Object[] accessArray(PriorityQueue<?> priorityQueue)
-
setSize
public static void setSize(PriorityQueue<?> priorityQueue, int size)
-
-