Package org.jivesoftware.openfire.group
Class ConcurrentGroupMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.concurrent.ConcurrentHashMap<K,V>
-
- org.jivesoftware.openfire.group.ConcurrentGroupMap<K,V>
-
- All Implemented Interfaces:
Serializable
,ConcurrentMap<K,V>
,Map<K,V>
,GroupAwareMap<K,V>
public class ConcurrentGroupMap<K,V> extends ConcurrentHashMap<K,V> implements GroupAwareMap<K,V>
This extension class provides additional methods that understand groups among the entries in the map.- Author:
- Tom Evans
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.ConcurrentHashMap
ConcurrentHashMap.KeySetView<K extends Object,V extends Object>
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description ConcurrentGroupMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Set<Group>
getGroupsFromKeys()
Returns the groups that are implied (resolvable) from the keys in the map.Set<Group>
getGroupsFromValues()
Returns the groups that are implied (resolvable) from the values in the map.boolean
includesKey(Object key)
Returns true if the key list contains the given JID.boolean
includesValue(Object value)
Returns true if the map has an entry value matching the given JID.V
put(K key, V value)
void
putAll(Map<? extends K,? extends V> m)
V
putIfAbsent(K key, V value)
V
remove(Object key)
boolean
remove(Object key, Object value)
V
replace(K key, V value)
boolean
replace(K key, V oldValue, V newValue)
-
Methods inherited from class java.util.concurrent.ConcurrentHashMap
compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, get, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, merge, newKeySet, newKeySet, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, values
-
Methods inherited from class java.util.AbstractMap
clone
-
-
-
-
Method Detail
-
includesKey
public boolean includesKey(Object key)
Returns true if the key list contains the given JID. If the JID is not found in the key list (exact match), search the key list for groups and look for the JID in each of the corresponding groups (implied match).- Specified by:
includesKey
in interfaceGroupAwareMap<K,V>
- Parameters:
key
- The target, presumably a JID- Returns:
- True if the target is in the key list, or in any groups in the key list
-
includesValue
public boolean includesValue(Object value)
Returns true if the map has an entry value matching the given JID. If the JID is not found in the value set (exact match), search the value set for groups and look for the JID in each of the corresponding groups (implied match).- Specified by:
includesValue
in interfaceGroupAwareMap<K,V>
- Parameters:
value
- The target, presumably a JID- Returns:
- True if the target is in the value set, or in any groups in the value set
-
getGroupsFromKeys
public Set<Group> getGroupsFromKeys()
Returns the groups that are implied (resolvable) from the keys in the map.- Specified by:
getGroupsFromKeys
in interfaceGroupAwareMap<K,V>
- Returns:
- A Set containing the groups among the keys
-
getGroupsFromValues
public Set<Group> getGroupsFromValues()
Returns the groups that are implied (resolvable) from the values in the map.- Specified by:
getGroupsFromValues
in interfaceGroupAwareMap<K,V>
- Returns:
- A Set containing the groups among the values
-
putIfAbsent
public V putIfAbsent(K key, V value)
- Specified by:
putIfAbsent
in interfaceConcurrentMap<K,V>
- Specified by:
putIfAbsent
in interfaceMap<K,V>
- Overrides:
putIfAbsent
in classConcurrentHashMap<K,V>
-
-