Package org.jivesoftware.openfire.group
Class ConcurrentGroupList<T>
- java.lang.Object
-
- java.util.concurrent.CopyOnWriteArrayList<T>
-
- org.jivesoftware.openfire.group.ConcurrentGroupList<T>
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<T>,Collection<T>,List<T>,RandomAccess,GroupAwareList<T>
public class ConcurrentGroupList<T> extends CopyOnWriteArrayList<T> implements GroupAwareList<T>
This list specifies additional methods that understand groups among the items in the list.- Author:
- Tom Evans
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConcurrentGroupList()ConcurrentGroupList(Collection<? extends T> c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, T element)booleanadd(T e)booleanaddAll(int index, Collection<? extends T> c)booleanaddAll(Collection<? extends T> c)intaddAllAbsent(Collection<? extends T> c)booleanaddIfAbsent(T e)voidclear()Set<Group>getGroups()Returns the groups that are implied (resolvable) from the items in the list.booleanincludes(Object value)Returns true if the list contains the given JID.Tremove(int index)booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)Tset(int index, T element)-
Methods inherited from class java.util.concurrent.CopyOnWriteArrayList
clone, contains, containsAll, equals, forEach, get, hashCode, indexOf, indexOf, isEmpty, iterator, lastIndexOf, lastIndexOf, listIterator, listIterator, removeIf, replaceAll, size, sort, spliterator, subList, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, replaceAll, size, sort, spliterator, subList, toArray, toArray
-
-
-
-
Constructor Detail
-
ConcurrentGroupList
public ConcurrentGroupList()
-
ConcurrentGroupList
public ConcurrentGroupList(Collection<? extends T> c)
-
-
Method Detail
-
includes
public boolean includes(Object value)
Returns true if the list contains the given JID. If the JID is not found in the list, search the list for groups and look for the JID in each of the corresponding groups.- Specified by:
includesin interfaceGroupAwareList<T>- Parameters:
value- The target, presumably a JID- Returns:
- True if the target is in the list, or in any groups in the list
-
getGroups
public Set<Group> getGroups()
Returns the groups that are implied (resolvable) from the items in the list.- Specified by:
getGroupsin interfaceGroupAwareList<T>- Returns:
- A Set containing the groups in the list
-
add
public boolean add(T e)
- Specified by:
addin interfaceCollection<T>- Specified by:
addin interfaceList<T>- Overrides:
addin classCopyOnWriteArrayList<T>
-
add
public void add(int index, T element)
-
remove
public T remove(int index)
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<T>- Specified by:
removein interfaceList<T>- Overrides:
removein classCopyOnWriteArrayList<T>
-
addIfAbsent
public boolean addIfAbsent(T e)
- Overrides:
addIfAbsentin classCopyOnWriteArrayList<T>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<T>- Specified by:
removeAllin interfaceList<T>- Overrides:
removeAllin classCopyOnWriteArrayList<T>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<T>- Specified by:
retainAllin interfaceList<T>- Overrides:
retainAllin classCopyOnWriteArrayList<T>
-
addAllAbsent
public int addAllAbsent(Collection<? extends T> c)
- Overrides:
addAllAbsentin classCopyOnWriteArrayList<T>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<T>- Specified by:
clearin interfaceList<T>- Overrides:
clearin classCopyOnWriteArrayList<T>
-
addAll
public boolean addAll(Collection<? extends T> c)
- Specified by:
addAllin interfaceCollection<T>- Specified by:
addAllin interfaceList<T>- Overrides:
addAllin classCopyOnWriteArrayList<T>
-
addAll
public boolean addAll(int index, Collection<? extends T> c)
-
-