JavaTM Platform
Standard Ed. 6

javax.management
类 AttributeList

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

public class AttributeList
extends ArrayList<Object>

表示 MBean 属性值的列表。用于在 AttributeList 中插入 Attribute 对象的方法应重写超类 ArrayList 中的相应方法。为了确保 AttributeList 中所包含的对象只是 Attribute 对象,这是必需的。这可避免在检索 AttributeList 中的元素时出现异常。

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

字段摘要
 
从类 java.util.AbstractList 继承的字段
modCount
 
构造方法摘要
AttributeList()
          构造一个空 AttributeList
AttributeList(AttributeList list)
          构造一个包含指定 AttributeList 元素的 AttributeList,元素的顺序是该 AttributeList 的迭代器所返回的顺序。
AttributeList(int initialCapacity)
          构造一个具有指定初始容量的空 AttributeList
AttributeList(List<Attribute> list)
          构造一个包含指定 List 的元素的 AttributeList,这些元素按 List 的迭代器返回的顺序排列。
 
方法摘要
 void add(Attribute object)
          添加指定的 Attribute 作为列表的最后一个元素。
 void add(int index, Attribute object)
          插入指定的属性作为指定位置处的元素。
 void add(int index, Object element)
          将指定的元素插入此列表中的指定位置。
 boolean add(Object o)
          将指定的元素添加到此列表的尾部。
 boolean addAll(AttributeList list)
          将指定 AttributeList 中的所有元素追加到列表的末尾,元素的顺序是指定 AttributeList 的 Iterator 所返回的顺序。
 boolean addAll(Collection<?> c)
          按照指定 collection 的迭代器所返回的元素顺序,将该 collection 中的所有元素添加到此列表的尾部。
 boolean addAll(int index, AttributeList list)
          将指定 AttributeList 中的所有元素插入此列表,从指定的位置开始插入,元素的顺序是指定 Attribute 的 Iterator 所返回的顺序。
 boolean addAll(int index, Collection<?> c)
          从指定的位置开始,将指定 collection 中的所有元素插入到此列表中。
 List<Attribute> asList()
          以 List<Attribute> 的形式返回此列表的视图。
 void set(int index, Attribute object)
          将指定位置的元素设置为指定的属性。
 Object set(int index, Object element)
          用指定的元素替代此列表中指定位置上的元素。
 
从类 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
 

构造方法详细信息

AttributeList

public AttributeList()
构造一个空 AttributeList


AttributeList

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

参数:
initialCapacity - AttributeList 的初始容量,正如 ArrayList.ArrayList(int) 所指定的那样。

AttributeList

public AttributeList(AttributeList list)
构造一个包含指定 AttributeList 元素的 AttributeList,元素的顺序是该 AttributeList 的迭代器所返回的顺序。AttributeList 实例的初始容量是指定 AttributeList 大小的 110%。

参数:
list - 定义新 AttributeList 的初始内容的 AttributeList
另请参见:
ArrayList.ArrayList(java.util.Collection)

AttributeList

public AttributeList(List<Attribute> list)
构造一个包含指定 List 的元素的 AttributeList,这些元素按 List 的迭代器返回的顺序排列。

参数:
list - 定义新 AttributeList 初始内容的 List
抛出:
IllegalArgumentException - 如果 list 参数为 null 或者 list 参数包含任何非 Attribute 对象。
从以下版本开始:
1.6
另请参见:
ArrayList.ArrayList(java.util.Collection)
方法详细信息

asList

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

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

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

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

add

public void add(Attribute object)
添加指定的 Attribute 作为列表的最后一个元素。

参数:
object - 要添加的属性。

add

public void add(int index,
                Attribute object)
插入指定的属性作为指定位置处的元素。其索引大于等于当前位置索引的元素会向上移动。如果 index 超出范围 (index < 0 || index > size()),则将引发 RuntimeOperationsException,并包装所抛出的 java.lang.IndexOutOfBoundsException。

参数:
object - 要插入的 Attribute 对象。
index - 列表中插入新 Attribute 对象的位置。

set

public void set(int index,
                Attribute object)
将指定位置的元素设置为指定的属性。丢弃该位置以前的元素。如果 index 超出范围 (index < 0 || index > size()),则将引发 RuntimeOperationsException,并包装所抛出的 java.lang.IndexOutOfBoundsException。

参数:
object - 属性元素应该被设置的值。
index - 指定的位置。

addAll

public boolean addAll(AttributeList list)
将指定 AttributeList 中的所有元素追加到列表的末尾,元素的顺序是指定 AttributeList 的 Iterator 所返回的顺序。

参数:
list - 要插入该列表的元素。
返回:
如果此列表由于调用而更改,则返回 true。
另请参见:
ArrayList.addAll(java.util.Collection)

addAll

public boolean addAll(int index,
                      AttributeList list)
将指定 AttributeList 中的所有元素插入此列表,从指定的位置开始插入,元素的顺序是指定 Attribute 的 Iterator 所返回的顺序。如果 index 超出范围 (index < 0 || index > size()),则将引发 RuntimeOperationsException,并包装所抛出的 java.lang.IndexOutOfBoundsException。

参数:
list - 要插入该列表的元素。
index - 插入指定 AttributeList 中首个元素的位置。
返回:
如果此列表由于调用而更改,则返回 true。
另请参见:
ArrayList.addAll(int, java.util.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 Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策