Class UnsafeOneToOneIndex<K,V>
java.lang.Object
com.atlassian.bamboo.plan.cache.index.util.unsafe.UnsafeOneToOneIndex<K,V>
A class that allows to index any key <-> value, one-to-one relationship. The key characteristics of this class is that,
unlike Map<K,V>, it doesn't require linear scan when removing by value.
Both K and V must have hashCode() and equals() correctly defined.
This class is _not_ thread safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToIndex
(K key, V value) To be used when you can be sure no prior mapping exists for both key and value.void
clear()
getByValue
(V value) void
removeByKey
(K key) removeByValue
(V value)
-
Constructor Details
-
UnsafeOneToOneIndex
public UnsafeOneToOneIndex() -
UnsafeOneToOneIndex
-
-
Method Details
-
addToIndex
To be used when you can be sure no prior mapping exists for both key and value. -
index
-
getForwardMapping
-
getBackwardMapping
-
removeByKey
-
removeByValue
-
getByKey
-
getByValue
-
clear
public void clear()
-