public class AttributeList extends ArrayList<Object>
表示MBean属性值的列表。 见getAttributes种setAttributes的方法MBeanServer和MBeanServerConnection 。
出于兼容性考虑,这是可能的,虽然非常气馁,将对象添加到AttributeList不在的情况下, Attribute 。 但是, AttributeList可以是类型安全的 ,这意味着尝试添加不是Attribute的对象将产生一个IllegalArgumentException 。 当方法asList()被调用时, AttributeList变得类型安全。
modCount| Constructor and Description |
|---|
AttributeList()
构造一个空的
AttributeList 。
|
AttributeList(AttributeList list)
构造一个
AttributeList含有的元素
AttributeList指定,在其中它们被返回的顺序
AttributeList的迭代器。
|
AttributeList(int initialCapacity)
构造一个空的
AttributeList ,具有指定的初始容量。
|
AttributeList(List<Attribute> list)
构造一个
AttributeList含有的元素
List指定,在其中它们被返回的顺序
List的迭代器。
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Attribute object)
添加
Attribute指定为列表中最后一个元素。
|
void |
add(int index, Attribute object)
在指定的位置插入指定为元素的属性。
|
void |
add(int index, Object element)
在此列表中的指定位置插入指定的元素。
|
boolean |
add(Object element)
将指定的元素追加到此列表的末尾。
|
boolean |
addAll(AttributeList list)
将
AttributeList指定的所有元素追加到列表的末尾,按照指定的
AttributeList的迭代器返回的顺序。
|
boolean |
addAll(Collection<?> c)
按指定集合的Iterator返回的顺序将指定集合中的所有元素追加到此列表的末尾。
|
boolean |
addAll(int index, AttributeList list)
所有插入的元素
AttributeList它们被通过的迭代器返回指定到这个列表,开始在指定的位置,在订单
AttributeList规定。
|
boolean |
addAll(int index, Collection<?> c)
将指定集合中的所有元素插入到此列表中,从指定的位置开始。
|
List<Attribute> |
asList()
将此列表的视图作为
List<Attribute> 。
|
void |
set(int index, Attribute object)
将元素设置为指定的属性。
|
Object |
set(int index, Object element)
用指定的元素替换此列表中指定位置的元素。
|
clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSizeequals, hashCodecontainsAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCodeparallelStream, streampublic AttributeList()
AttributeList 。
public AttributeList(int initialCapacity)
AttributeList ,具有指定的初始容量。
initialCapacity -所述的初始容量
AttributeList ,如通过指定
ArrayList.ArrayList(int) 。
public AttributeList(AttributeList list)
AttributeList含有的元素AttributeList指定,在其中它们被返回的顺序AttributeList的迭代器。
AttributeList实例的初始容量为AttributeList AttributeList大小的110%。
list -
AttributeList定义了新的
AttributeList的初始内容。
ArrayList.ArrayList(java.util.Collection)
public AttributeList(List<Attribute> list)
AttributeList含有的元素
List指定,在其中它们被返回的顺序
List的迭代器。
list -所述
List定义新的初始内容
AttributeList 。
IllegalArgumentException - 如果
list参数是
null或
list参数包含任何非属性对象。
ArrayList.ArrayList(java.util.Collection)
public List<Attribute> asList()
List<Attribute> 。
返回值的更改反映在原始AttributeList的更改中,反之亦然。
List<Attribute>的内容反映了这个AttributeList的内容。
如果在给定的AttributeList实例中调用了此方法,则后续尝试将对象添加到不是Attribute实例将失败,并使用IllegalArgumentException 。 出于兼容性考虑,一个AttributeList上这种方法从未被称为确实允许比其他对象Attribute进行增补。
IllegalArgumentException - 如果这个
AttributeList包含不是
Attribute的元素。
public void add(Attribute object)
Attribute指定为列表中最后一个元素。
object - 要添加的属性。
public void add(int index,
Attribute object)
object - 要插入的
Attribute对象。
index - 要插入新的
Attribute对象的列表中的位置。
public void set(int index,
Attribute object)
object - 应该设置属性元素的值。
index - 指定的位置。
public boolean addAll(AttributeList list)
AttributeList中的所有元素附加到列表的末尾,按照指定的
AttributeList的迭代器返回它们的顺序。
list - 要插入列表的元素。
ArrayList.addAll(java.util.Collection)
public boolean addAll(int index,
AttributeList list)
AttributeList它们被通过的迭代器返回指定到这个列表,开始在指定的位置,在订单AttributeList规定。
如果索引超出范围(index <0 || index> size()),则应引发RuntimeOperationsException,并引发抛出java.lang.IndexOutOfBoundsException异常。
list - 要插入到列表中的元素。
index - 从指定的
AttributeList插入第一个元素的位置。
ArrayList.addAll(int, java.util.Collection)
public boolean add(Object element)
add在界面
Collection<Object>
add在界面
List<Object>
add在
ArrayList<Object>
element - 要附加到此列表的元素
Collection.add(E)指定 )
IllegalArgumentException - 如果这
AttributeList是
type-safe和
element不是
Attribute 。
public void add(int index,
Object element)
public boolean addAll(Collection<?> c)
addAll在界面
Collection<Object>
addAll在界面
List<Object>
addAll在
ArrayList<Object>
c - 包含要添加到此列表中的元素的集合
IllegalArgumentException - 如果这个
AttributeList是
type-safe和
c包含不是
Attribute的元素。
AbstractCollection.add(Object)
public boolean addAll(int index,
Collection<?> c)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.