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 void
add(int index, T element)
boolean
add(T e)
boolean
addAll(int index, Collection<? extends T> c)
boolean
addAll(Collection<? extends T> c)
int
addAllAbsent(Collection<? extends T> c)
boolean
addIfAbsent(T e)
void
clear()
Set<Group>
getGroups()
Returns the groups that are implied (resolvable) from the items in the list.boolean
includes(Object value)
Returns true if the list contains the given JID.T
remove(int index)
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
T
set(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:
includes
in 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:
getGroups
in interfaceGroupAwareList<T>
- Returns:
- A Set containing the groups in the list
-
add
public boolean add(T e)
- Specified by:
add
in interfaceCollection<T>
- Specified by:
add
in interfaceList<T>
- Overrides:
add
in classCopyOnWriteArrayList<T>
-
add
public void add(int index, T element)
-
remove
public T remove(int index)
-
remove
public boolean remove(Object o)
- Specified by:
remove
in interfaceCollection<T>
- Specified by:
remove
in interfaceList<T>
- Overrides:
remove
in classCopyOnWriteArrayList<T>
-
addIfAbsent
public boolean addIfAbsent(T e)
- Overrides:
addIfAbsent
in classCopyOnWriteArrayList<T>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interfaceCollection<T>
- Specified by:
removeAll
in interfaceList<T>
- Overrides:
removeAll
in classCopyOnWriteArrayList<T>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll
in interfaceCollection<T>
- Specified by:
retainAll
in interfaceList<T>
- Overrides:
retainAll
in classCopyOnWriteArrayList<T>
-
addAllAbsent
public int addAllAbsent(Collection<? extends T> c)
- Overrides:
addAllAbsent
in classCopyOnWriteArrayList<T>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<T>
- Specified by:
clear
in interfaceList<T>
- Overrides:
clear
in classCopyOnWriteArrayList<T>
-
addAll
public boolean addAll(Collection<? extends T> c)
- Specified by:
addAll
in interfaceCollection<T>
- Specified by:
addAll
in interfaceList<T>
- Overrides:
addAll
in classCopyOnWriteArrayList<T>
-
addAll
public boolean addAll(int index, Collection<? extends T> c)
-
-