Package one.microstream.memory
Class XMemoryJDK8
- java.lang.Object
-
- one.microstream.memory.XMemoryJDK8
-
public final class XMemoryJDK8 extends Object
-
-
Constructor Summary
Constructors Constructor Description XMemoryJDK8()
-
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)
-
-