JavaTM 2 Platform
Standard Ed. 6

javax.management.relation
类 RoleList

java.lang.Object
  继承者 java.util.AbstractCollection<E>
      继承者 java.util.AbstractList<E>
          继承者 java.util.ArrayList<Object>
              继承者 javax.management.relation.RoleList
所有已实现的接口:
Serializable, Cloneable, Iterable<Object>, Collection<Object>, List<Object>, RandomAccess

public class RoleList
extends ArrayList<Object>

RoleList 表示角色(Role 对象)的列表。它在创建关系和试图在关系中设置几个角色(通过 'setRoles()'方法)时用作参数。它将作为 RoleResult 的一部分返回,以提供成功检索的角色。

从以下版本开始:
1.5
另请参见:
序列化表格

字段摘要
 
从类 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
 

构造方法详细信息

RoleList

public RoleList()
构造一个空的 RoleList。


RoleList

public RoleList(int initialCapacity)
构造一个具有指定初始容量的空 RoleList。

参数:
initialCapacity - 初始容量

RoleList

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)
方法详细信息

asList

public List<Role> asList()
List<Role> 的形式返回此列表的示图。对返回值的更改将通过对原 RoleList 的更改反映出来,反之亦然。

返回:
一个 List<Role>,其内容反映此 RoleList 的内容。

如果曾经对给定的 RoleList 实例调用过此方法,则之后试图对该实例添加非 Role 对象的操作将会失败,并抛出 IllegalArgumentException。出于兼容性原因,允许向从未调用过此方法的 RoleList 添加非 Role 对象。

抛出:
IllegalArgumentException - 如果此 RoleList 包含非 Role 元素。
从以下版本开始:
1.6

add

public void add(Role role)
         throws IllegalArgumentException
添加指定为列表中最后一个元素的 Role。

参数:
role - 要添加的角色。
抛出:
IllegalArgumentException - 如果角色为 null。

add

public void add(int index,
                Role role)
         throws IllegalArgumentException,
                IndexOutOfBoundsException
插入指定为指定位置处的元素的角色。将其索引大于或等于当前位置的元素上移。

参数:
index - 在列表中要插入新 Role 对象的位置。
role - 要插入的 Role 对象。
抛出:
IllegalArgumentException - 如果角色为 null。
IndexOutOfBoundsException - 如果用列表之外的索引访问。

set

public void set(int index,
                Role role)
         throws IllegalArgumentException,
                IndexOutOfBoundsException
将指定位置处的元素设置为指定角色。丢弃该位置以前的元素。

参数:
index - 指定的位置。
role - 角色元素应该设置为的值。
抛出:
IllegalArgumentException - 如果角色为 null。
IndexOutOfBoundsException - 如果用列表之外的索引访问。

addAll

public boolean addAll(RoleList roleList)
               throws IndexOutOfBoundsException
将指定 RoleList 中的所有元素追加到列表末尾,这些元素按指定 RoleList 的迭代器返回的顺序排列。

参数:
roleList - 要插入列表的元素(可以为 null)
返回:
如果此列表由于调用而更改,则返回 true。
抛出:
IndexOutOfBoundsException - 如果用列表之外的索引访问。
另请参见:
ArrayList.addAll(Collection)

addAll

public boolean addAll(int index,
                      RoleList roleList)
               throws IllegalArgumentException,
                      IndexOutOfBoundsException
从指定位置开始,将指定 RoleList 中的所有元素插入此列表,这些元素按指定 RoleList 的迭代器返回的顺序排列。

参数:
index - 插入指定 RoleList 中第一个元素的位置。
roleList - 要插入该列表的元素。
返回:
如果此列表由于调用而更改,则返回 true。
抛出:
IllegalArgumentException - 如果角色为 null。
IndexOutOfBoundsException - 如果用列表之外的索引访问。
另请参见:
ArrayList.addAll(int, Collection)

add

public boolean add(Object o)
从类 ArrayList 复制的描述
将指定的元素添加到此列表的尾部。

指定者:
接口 Collection<Object> 中的 add
指定者:
接口 List<Object> 中的 add
覆盖:
ArrayList<Object> 中的 add
参数:
o - 要添加到此列表中的元素
返回:
true(按照 Collection.add(E) 的指定)

add

public void add(int index,
                Object element)
从类 ArrayList 复制的描述
将指定的元素插入此列表中的指定位置。向右移动当前位于该位置的元素(如果有)以及所有后续元素(将其索引加 1)。

指定者:
接口 List<Object> 中的 add
覆盖:
ArrayList<Object> 中的 add
参数:
index - 指定元素所插入位置的索引
element - 要插入的元素

addAll

public boolean addAll(Collection<?> c)
从类 ArrayList 复制的描述
按照指定 collection 的迭代器所返回的元素顺序,将该 collection 中的所有元素添加到此列表的尾部。如果正在进行此操作时修改指定的 collection ,那么此操作的行为是不确定的。(这意味着如果指定的 collection 是此列表且此列表是非空的,那么此调用的行为是不确定的)。

指定者:
接口 Collection<Object> 中的 addAll
指定者:
接口 List<Object> 中的 addAll
覆盖:
ArrayList<Object> 中的 addAll
参数:
c - 包含要添加到此列表中的元素的 collection
返回:
如果此列表由于调用而发生更改,则返回 true
另请参见:
AbstractCollection.add(Object)

addAll

public boolean addAll(int index,
                      Collection<?> c)
从类 ArrayList 复制的描述
从指定的位置开始,将指定 collection 中的所有元素插入到此列表中。向右移动当前位于该位置的元素(如果有)以及所有后续元素(增加其索引)。新元素将按照指定 collection 的迭代器所返回的元素顺序出现在列表中。

指定者:
接口 List<Object> 中的 addAll
覆盖:
ArrayList<Object> 中的 addAll
参数:
index - 插入指定 collection 中的首个元素的位置索引
c - 包含要添加到此列表中元素的 collection
返回:
如果此列表由于调用而发生更改,则返回 true

set

public Object set(int index,
                  Object element)
从类 ArrayList 复制的描述
用指定的元素替代此列表中指定位置上的元素。

指定者:
接口 List<Object> 中的 set
覆盖:
ArrayList<Object> 中的 set
参数:
index - 要替代的元素的索引
element - 存储在指定位置上的元素
返回:
以前位于该指定位置上的元素

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only