- 所有已实现的接口:
Serializable,Cloneable,Iterable<Object>,Collection<Object>,List<Object>,RandomAccess
RoleList 表示角色列表(角色对象)。它在创建关系以及尝试在关系中设置多个角色时用作参数(通过“setRoles()”方法)。它作为 RoleResult 的一部分返回,以提供成功检索的角色。
- 自从:
- 1.5
- 参见:
-
字段摘要
在类 java.util.AbstractList 中声明的字段
modCount -
构造方法总结
构造方法 -
方法总结
修饰符和类型方法描述void在指定位置插入指定为元素的角色。void添加指定为列表最后一个元素的角色。boolean将指定 RoleList 中的所有元素插入此list,从指定位置开始,按照它们由指定 RoleList 的 Iterator 返回的顺序。boolean将指定的 RoleList 中的所有元素追加到列表的末尾,按照它们由指定的 RoleList 的迭代器返回的顺序。asList()将此list的视图作为List<Role>返回。void将指定位置的元素设置为指定的角色。在类 java.util.ArrayList 中声明的方法
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, retainAll, set, size, spliterator, subList, toArray, toArray, trimToSize在类 java.util.AbstractList 中声明的方法
equals, hashCode在类 java.util.AbstractCollection 中声明的方法
containsAll, toString在接口 java.util.Collection 中声明的方法
parallelStream, stream, toArray在接口 java.util.List 中声明的方法
containsAll, replaceAll, sort
-
构造方法详细信息
-
RoleList
public RoleList()构造一个空的 RoleList。 -
RoleList
public RoleList(int initialCapacity) 构造一个具有指定初始容量的空 RoleList。- 参数:
initialCapacity- 初始容量
-
RoleList
构造一个包含指定List元素的RoleList,按照它们由List的迭代器返回的顺序。RoleList实例的初始容量为指定的List大小的 110%。- 参数:
list- 定义新RoleList初始内容的List。- 抛出:
IllegalArgumentException- 如果list参数是null或者如果list参数包含任何非角色对象。- 参见:
-
-
方法详情
-
asList
将此list的视图作为List<Role>返回。对返回值的更改会反映在对原始RoleList的更改中,反之亦然。- 返回:
-
一个
List<Role>其内容反映了这个RoleList的内容。如果曾在给定的
RoleList实例上调用过此方法,则随后尝试向该实例添加一个不是Role的对象将失败并返回IllegalArgumentException。出于兼容性原因,从未调用过此方法的RoleList允许添加Role以外的对象。 - 抛出:
IllegalArgumentException- 如果这个RoleList包含一个不是Role的元素。- 自从:
- 1.6
-
add
添加指定为列表最后一个元素的角色。- 参数:
role- 要添加的角色。- 抛出:
IllegalArgumentException- 如果角色为空。
-
add
在指定位置插入指定为元素的角色。索引大于或等于当前位置的元素向上移动。- 参数:
index- 列表中要插入新 Role 对象的位置。role- 要插入的角色对象。- 抛出:
IllegalArgumentException- 如果角色为空。IndexOutOfBoundsException- 如果使用列表外的索引进行访问。
-
set
将指定位置的元素设置为指定的角色。该位置的前一个元素将被丢弃。- 参数:
index- 指定的位置。role- 角色元素应设置的值。- 抛出:
IllegalArgumentException- 如果角色为空。IndexOutOfBoundsException- 如果使用列表外的索引进行访问。
-
addAll
将指定的 RoleList 中的所有元素追加到列表的末尾,按照它们由指定的 RoleList 的迭代器返回的顺序。- 参数:
roleList- 要插入到列表中的元素(可以为空)- 返回:
- 如果此list因调用而更改,则为真。
- 抛出:
IndexOutOfBoundsException- 如果使用列表外的索引进行访问。- 参见:
-
addAll
public boolean addAll(int index, RoleList roleList) throws IllegalArgumentException , IndexOutOfBoundsException 将指定 RoleList 中的所有元素插入此list,从指定位置开始,按照它们由指定 RoleList 的 Iterator 返回的顺序。- 参数:
index- 从指定的 RoleList 中插入第一个元素的位置。roleList- 要插入到列表中的元素。- 返回:
- 如果此list因调用而更改,则为真。
- 抛出:
IllegalArgumentException- 如果角色为空。IndexOutOfBoundsException- 如果使用列表外的索引进行访问。- 参见:
-