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 voidclear()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.booleanincludesKey(Object key)Returns true if the key list contains the given JID.booleanincludesValue(Object value)Returns true if the map has an entry value matching the given JID.Vput(K key, V value)voidputAll(Map<? extends K,? extends V> m)VputIfAbsent(K key, V value)Vremove(Object key)booleanremove(Object key, Object value)Vreplace(K key, V value)booleanreplace(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:
includesKeyin 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:
includesValuein 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:
getGroupsFromKeysin 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:
getGroupsFromValuesin interfaceGroupAwareMap<K,V>- Returns:
- A Set containing the groups among the values
-
putIfAbsent
public V putIfAbsent(K key, V value)
- Specified by:
putIfAbsentin interfaceConcurrentMap<K,V>- Specified by:
putIfAbsentin interfaceMap<K,V>- Overrides:
putIfAbsentin classConcurrentHashMap<K,V>
-
-