public final class ClassMap<V>
extends java.lang.Object
Map
instance. It is very fast
on un-synchronized lookups, faster then HashMap
.
Uses identity for checking if Class
keys are equal.
The initial version of this class was provided by @zqq90, from WebIt-script project. Thank you!
Constructor and Description |
---|
ClassMap() |
ClassMap(int initialCapacity)
Creates new map with given initial capacity.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the class map.
|
V |
get(java.lang.Class key)
Returns a value associated to a key in thread-safe way.
|
V |
put(java.lang.Class key,
V value)
Associates the specified value with the specified Class in this map.
|
int |
size()
Returns total number of stored classes.
|
V |
unsafeGet(java.lang.Class key)
Returns a value associated to a key in unsafe, but very fast way.
|
public ClassMap(int initialCapacity)
public ClassMap()
public int size()
public V unsafeGet(java.lang.Class key)
public V get(java.lang.Class key)
public V put(java.lang.Class key, V value)
null
if there was no mapping for key.public void clear()
Copyright © 2003-present Jodd Team