|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A collection of members backed by any common collection type (Set, List, SetList) as the group store to achieve ordering and/or uniqueness in the group, as well as efficient group mutation. Includes lightweight support for building lists (if the group store is a List). The identity (equals(), hashCode()) of a group is that of the group store (tries List first, then Set view), with an instanceof test for Group.
Method Summary | |
void |
add(int index,
java.lang.Object member)
Similar to List.add(int, Object), but functionally equivalent to Collection.add(Object) if index is <0. |
void |
addAll(int index,
java.util.Collection members)
Similar to List.addAll(int, Collection), but functionally equivalent to Collection.addAll(Collection) if index is <0. |
boolean |
containsAny(java.util.Collection members)
Returns true if this group contains any of the specified members. |
Group |
getGroup()
Gets an immutable view of this group. |
java.util.List |
getList()
Gets a singleton immutable view of the group store as a list, which is useful for testing equality with another list. |
java.util.Set |
getSet()
Gets a singleton immutable view of the group store as a set, which is useful for testing equality with another set. |
Methods inherited from interface java.util.Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Method Detail |
public void add(int index, java.lang.Object member)
index
- Index of the added member. If <0 the member is added
to the end of the list.member
- The member to be added, which may be null.
java.lang.UnsupportedOperationException
- The group store is
not a List.public void addAll(int index, java.util.Collection members)
index
- Index of the first added member. If <0 the members
are added to the end of the list.members
- The members (Object) to be added, which may be null.
Never null.
java.lang.UnsupportedOperationException
- The group store is
not a List.public boolean containsAny(java.util.Collection members)
members
- The members, which may be null. Never null.
public Group getGroup()
public java.util.Set getSet()
java.lang.UnsupportedOperationException
- The group store is not
a Set or viewable as a Set.public java.util.List getList()
java.lang.UnsupportedOperationException
- The group store is not
a List or viewable as a List.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |