Class UnsafeManyToManyIndex<K,V>
java.lang.Object
com.atlassian.bamboo.plan.cache.index.util.unsafe.UnsafeManyToManyIndex<K,V>
A class that allows to index any key <-> value, many-to-many relationship. The key characteristics of this class is that,
unlike Multimap<K,V>, it doesn't require linear scan when removing by value.
Both K and V _must_ have hashCode() and equals() correctly defined.
The class is _not thread safe_.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
You need to synchronize on this object if using this method.getByKeyUnsafe
(K key) Does not perform a copy, can only be used in context that are thread safe from perspective of this objectgetByValue
(V value) getByValueUnsafe
(V value) Does not perform a copy, can only be used in context that are thread safe from perspective of this objectYou need to synchronize on this object if using this method.void
removeByKey
(K key) removeByValue
(V value)
-
Constructor Details
-
UnsafeManyToManyIndex
public UnsafeManyToManyIndex()
-
-
Method Details
-
index
-
getForwardMapping
You need to synchronize on this object if using this method. -
getBackwardMapping
You need to synchronize on this object if using this method. -
removeByKey
-
removeByValue
-
getByKey
-
getByKeyUnsafe
Does not perform a copy, can only be used in context that are thread safe from perspective of this object -
getByValue
-
getByValueUnsafe
Does not perform a copy, can only be used in context that are thread safe from perspective of this object -
clear
public void clear()
-