java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<Object>
javax.management.relation.RoleList
RoleList 表示角色(Role 对象)的列表。它在创建关系和试图在关系中设置几个角色(通过 'setRoles()'方法)时用作参数。它将作为 RoleResult 的一部分返回,以提供成功检索的角色。
| 字段摘要 |
|---|
| 从类 java.util.AbstractList 继承的字段 |
|---|
modCount |
| 构造方法摘要 | |
|---|---|
RoleList() 构造一个空的 RoleList。 |
|
RoleList(int initialCapacity) 构造一个具有指定初始容量的空 RoleList。 |
|
RoleList(List<Role> list) 构造一个包含指定 List 元素的 RoleList,这些元素按 List 迭代器返回的顺序排列。 |
|
| 方法摘要 | |
|---|---|
void |
add(int index, Object element) 将指定的元素插入此列表中的指定位置。 |
void |
add(int index, Role role) 插入指定为指定位置处的元素的角色。 |
boolean |
add(Object o) 将指定的元素添加到此列表的尾部。 |
void |
add(Role role) 添加指定为列表中最后一个元素的 Role。 |
boolean |
addAll(Collection<?> c) 按照指定 collection 的迭代器所返回的元素顺序,将该 collection 中的所有元素添加到此列表的尾部。 |
boolean |
addAll(int index, Collection<?> c) 从指定的位置开始,将指定 collection 中的所有元素插入到此列表中。 |
boolean |
addAll(int index, RoleList roleList) 从指定位置开始,将指定 RoleList 中的所有元素插入此列表,这些元素按指定 RoleList 的迭代器返回的顺序排列。 |
boolean |
addAll(RoleList roleList) 将指定 RoleList 中的所有元素追加到列表末尾,这些元素按指定 RoleList 的迭代器返回的顺序排列。 |
List<Role> |
asList() 以 List<Role> 的形式返回此列表的示图。 |
Object |
set(int index, Object element) 用指定的元素替代此列表中指定位置上的元素。 |
void |
set(int index, Role role) 将指定位置处的元素设置为指定角色。 |
| 从类 java.util.ArrayList 继承的方法 |
|---|
clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, size, toArray, toArray, trimToSize |
| 从类 java.util.AbstractList 继承的方法 |
|---|
equals, hashCode, iterator, listIterator, listIterator, subList |
| 从类 java.util.AbstractCollection 继承的方法 |
|---|
containsAll, removeAll, retainAll, toString |
| 从类 java.lang.Object 继承的方法 |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| 从接口 java.util.List 继承的方法 |
|---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
| 构造方法详细信息 |
|---|
public RoleList()
public RoleList(int initialCapacity)
initialCapacity - 初始容量
public RoleList(List<Role> list) throws IllegalArgumentException
List 元素的
RoleList,这些元素按
List 迭代器返回的顺序排列。
RoleList 实例的初始容量是指定
List 大小的 110%。
list - 定义新
RoleList 初始内容的
List。
IllegalArgumentException - 如果
list 参数为
null 或者
list 参数包含任何非 Role 对象。
ArrayList.ArrayList(java.util.Collection)
| 方法详细信息 |
|---|
public List<Role> asList()
List<Role> 的形式返回此列表的示图。对返回值的更改将通过对原
RoleList 的更改反映出来,反之亦然。
List<Role>,其内容反映此
RoleList 的内容。
如果曾经对给定的 RoleList 实例调用过此方法,则之后试图对该实例添加非 Role 对象的操作将会失败,并抛出 IllegalArgumentException。出于兼容性原因,允许向从未调用过此方法的 RoleList 添加非 Role 对象。
IllegalArgumentException - 如果此
RoleList 包含非
Role 元素。
public void add(Role role) throws IllegalArgumentException
role - 要添加的角色。
IllegalArgumentException - 如果角色为 null。
public void add(int index,
Role role)
throws IllegalArgumentException,
IndexOutOfBoundsException
index - 在列表中要插入新 Role 对象的位置。
role - 要插入的 Role 对象。
IllegalArgumentException - 如果角色为 null。
IndexOutOfBoundsException - 如果用列表之外的索引访问。
public void set(int index,
Role role)
throws IllegalArgumentException,
IndexOutOfBoundsException
index - 指定的位置。
role - 角色元素应该设置为的值。
IllegalArgumentException - 如果角色为 null。
IndexOutOfBoundsException - 如果用列表之外的索引访问。
public boolean addAll(RoleList roleList) throws IndexOutOfBoundsException
roleList - 要插入列表的元素(可以为 null)
IndexOutOfBoundsException - 如果用列表之外的索引访问。
ArrayList.addAll(Collection)
public boolean addAll(int index,
RoleList roleList)
throws IllegalArgumentException,
IndexOutOfBoundsException
index - 插入指定 RoleList 中第一个元素的位置。
roleList - 要插入该列表的元素。
IllegalArgumentException - 如果角色为 null。
IndexOutOfBoundsException - 如果用列表之外的索引访问。
ArrayList.addAll(int, Collection)
public boolean add(Object o)
ArrayList 复制的描述
o - 要添加到此列表中的元素
Collection.add(E) 的指定)
public void add(int index,
Object element)
ArrayList 复制的描述
index - 指定元素所插入位置的索引
element - 要插入的元素
public boolean addAll(Collection<?> c)
ArrayList 复制的描述
c - 包含要添加到此列表中的元素的 collection
AbstractCollection.add(Object)
public boolean addAll(int index,
Collection<?> c)
ArrayList 复制的描述
index - 插入指定 collection 中的首个元素的位置索引
c - 包含要添加到此列表中元素的 collection
public Object set(int index, Object element)