|
GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java (public API).
|
Implements a combination of WeakHashMap and IdentityHashMap. More...
Public Member Functions | |
| WeakIdentityHashMap () | |
See HashMap#HashMap(). More... | |
| WeakIdentityHashMap (final int initialCapacity, final float loadFactor) | |
See HashMap#HashMap(int, float). More... | |
| void | clear () |
| boolean | containsKey (final Object key) |
| boolean | containsValue (final Object value) |
| Set< Map.Entry< K, V > > | entrySet () |
| Set< K > | keySet () |
| boolean | equals (final Object o) |
| V | get (final Object key) |
| V | put (final K key, final V value) |
| int | hashCode () |
| boolean | isEmpty () |
| void | putAll (final Map<? extends K, ? extends V > t) |
| V | remove (final Object key) |
| int | size () |
| Collection< V > | values () |
Static Public Member Functions | |
| static WeakIdentityHashMap<?, ?> | createWithRequiredSize (final int requiredSize, final float loadFactor) |
Static creation method using capacityForRequiredSize(int, float[]) to instantiate a new WeakIdentityHashMap via WeakIdentityHashMap(int, float). More... | |
| static int | capacityForRequiredSize (final int requiredSize, final float[] loadFactor) |
Returns the [initial] capacity using the given loadFactor and requiredSize. More... | |
Implements a combination of WeakHashMap and IdentityHashMap.
Useful for caches that need to key off of a == comparison instead of a .equals.
This class is not a general-purpose Map implementation! While this class implements the Map interface, it intentionally violates Map's general contract, which mandates the use of the equals method when comparing objects. This class is designed for use only in the rare cases wherein reference-equality semantics are required.
Note that this implementation is not synchronized.
Definition at line 75 of file WeakIdentityHashMap.java.
See HashMap#HashMap().
Definition at line 82 of file WeakIdentityHashMap.java.
| com.jogamp.common.util.WeakIdentityHashMap< K, V >.WeakIdentityHashMap | ( | final int | initialCapacity, |
| final float | loadFactor | ||
| ) |
See HashMap#HashMap(int, float).
Usable slots before resize are capacity * loadFactor.
Capacity for n-slots w/o resize would be (float)n/loadFactor + 1.0f, see capacityForRequiredSize(int, float[]).
| initialCapacity | default value would be 16, i.e. 12 slots @ 0.75f loadFactor before resize |
| loadFactor | default value would be 0.75f |
Definition at line 99 of file WeakIdentityHashMap.java.
|
static |
Returns the [initial] capacity using the given loadFactor and requiredSize.
General calculation is (float)requiredSize/loadFactor + 1.0f, using loadFactor := 0.75f.
In case above computed capacity is Bitfield.Util#isPowerOf2(int), the given loadFactor will be increased to avoid next PowerOf2 table size initialization.
| requiredSize | the user desired n-slots before resize |
| loadFactor | given loadFactor, which might be increased a little to avoid next PowerOf2 bloat |
WeakIdentityHashMap(int, float) Definition at line 132 of file WeakIdentityHashMap.java.
| void com.jogamp.common.util.WeakIdentityHashMap< K, V >.clear | ( | ) |
Definition at line 151 of file WeakIdentityHashMap.java.
| boolean com.jogamp.common.util.WeakIdentityHashMap< K, V >.containsKey | ( | final Object | key | ) |
Definition at line 158 of file WeakIdentityHashMap.java.
| boolean com.jogamp.common.util.WeakIdentityHashMap< K, V >.containsValue | ( | final Object | value | ) |
Definition at line 164 of file WeakIdentityHashMap.java.
|
static |
Static creation method using capacityForRequiredSize(int, float[]) to instantiate a new WeakIdentityHashMap via WeakIdentityHashMap(int, float).
| requiredSize | the user desired n-slots before resize |
| loadFactor | given loadFactor, which might be increased a little to avoid next PowerOf2 bloat |
WeakIdentityHashMap instance Definition at line 112 of file WeakIdentityHashMap.java.
| Set< Map.Entry< K, V > > com.jogamp.common.util.WeakIdentityHashMap< K, V >.entrySet | ( | ) |
Definition at line 170 of file WeakIdentityHashMap.java.
| boolean com.jogamp.common.util.WeakIdentityHashMap< K, V >.equals | ( | final Object | o | ) |
Definition at line 213 of file WeakIdentityHashMap.java.
| V com.jogamp.common.util.WeakIdentityHashMap< K, V >.get | ( | final Object | key | ) |
Definition at line 222 of file WeakIdentityHashMap.java.
| int com.jogamp.common.util.WeakIdentityHashMap< K, V >.hashCode | ( | ) |
Definition at line 234 of file WeakIdentityHashMap.java.
| boolean com.jogamp.common.util.WeakIdentityHashMap< K, V >.isEmpty | ( | ) |
Definition at line 240 of file WeakIdentityHashMap.java.
| Set< K > com.jogamp.common.util.WeakIdentityHashMap< K, V >.keySet | ( | ) |
Definition at line 200 of file WeakIdentityHashMap.java.
| V com.jogamp.common.util.WeakIdentityHashMap< K, V >.put | ( | final K | key, |
| final V | value | ||
| ) |
Definition at line 228 of file WeakIdentityHashMap.java.
| void com.jogamp.common.util.WeakIdentityHashMap< K, V >.putAll | ( | final Map<? extends K, ? extends V > | t | ) |
| V com.jogamp.common.util.WeakIdentityHashMap< K, V >.remove | ( | final Object | key | ) |
Definition at line 262 of file WeakIdentityHashMap.java.
| int com.jogamp.common.util.WeakIdentityHashMap< K, V >.size | ( | ) |
Definition at line 268 of file WeakIdentityHashMap.java.
| Collection< V > com.jogamp.common.util.WeakIdentityHashMap< K, V >.values | ( | ) |
Definition at line 274 of file WeakIdentityHashMap.java.