- 所有已实现的接口:
-
Serializable,Cloneable,Iterable<Object>,Collection<Object>,List<Object>,RandomAccess,SequencedCollection<Object>
表示MBean属性值列表。请参阅getAttributes和setAttributes方法的MBeanServer和MBeanServerConnection。
出于兼容性原因,可以向AttributeList添加非Attribute实例的对象,尽管强烈不建议这样做。但是,AttributeList可以被设置为类型安全,这意味着尝试添加非Attribute对象将导致IllegalArgumentException异常。调用asList()方法后,AttributeList将变为类型安全。
- 自版本:
- 1.5
- 另请参见:
-
Field Summary
Fields declared in class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescription构造一个空的AttributeList。AttributeList(int initialCapacity) 构造一个具有指定初始容量的空的AttributeList。AttributeList(List<Attribute> list) 构造一个包含指定List元素的AttributeList,顺序与List的迭代器返回的顺序相同。AttributeList(AttributeList list) 构造一个包含指定AttributeList元素的AttributeList,顺序与AttributeList的迭代器返回的顺序相同。 -
Method Summary
Modifier and TypeMethodDescriptionvoid在列表中的指定位置插入指定的元素。void在指定位置插入指定的属性作为元素。boolean将指定的元素追加到列表末尾。void将指定的Attribute作为列表的最后一个元素添加。booleanaddAll(int index, Collection<?> c) 将指定集合中的所有元素从指定位置开始插入到此列表中。booleanaddAll(int index, AttributeList list) 将指定AttributeList中的所有元素从指定位置开始插入到此列表中,顺序与指定AttributeList的迭代器返回的顺序相同。booleanaddAll(Collection<?> c) 将指定集合中的所有元素追加到此列表的末尾,顺序与指定集合的迭代器返回的顺序相同。booleanaddAll(AttributeList list) 将指定的AttributeList中的所有元素追加到列表的末尾,顺序与指定AttributeList的迭代器返回的顺序相同。asList()返回此列表的List<Attribute>视图。用指定的元素替换列表中指定位置的元素。void将指定的属性作为元素设置到指定位置。Methods declared in class java.util.ArrayList
addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, retainAll, size, spliterator, subList, toArray, toArray, trimToSizeMethods declared in class java.util.AbstractList
equals, hashCodeMethods declared in class java.util.AbstractCollection
containsAll, toStringMethods declared in interface java.util.Collection
parallelStream, stream, toArrayMethods declared in interface java.util.List
containsAll, replaceAll, reversed, sort
-
Constructor Details
-
AttributeList
public AttributeList()构造一个空的AttributeList。 -
AttributeList
public AttributeList(int initialCapacity) 构造一个具有指定初始容量的空的AttributeList。- 参数:
-
initialCapacity-AttributeList的初始容量,由ArrayList(int)指定。
-
AttributeList
构造一个包含指定AttributeList元素的AttributeList,顺序与AttributeList的迭代器返回的顺序相同。该AttributeList实例的初始容量为指定AttributeList大小的110%。- 参数:
-
list- 定义新AttributeList初始内容的AttributeList。 - 另请参见:
-
AttributeList
构造一个包含指定List元素的AttributeList,顺序与List的迭代器返回的顺序相同。- 参数:
-
list- 定义新AttributeList初始内容的List。 - 抛出:
-
IllegalArgumentException- 如果list参数为null或者list参数包含任何非Attribute对象。 - 自版本:
- 1.6
- 另请参见:
-
-
Method Details
-
asList
返回此列表的List<Attribute>视图。对返回值的更改会反映在原始AttributeList上,反之亦然。- 返回:
-
反映此
AttributeList内容的List<Attribute>。如果在给定
AttributeList实例上曾调用过此方法,则随后尝试向该实例添加非Attribute对象的操作将导致IllegalArgumentException异常。出于兼容性原因,从未调用过此方法的AttributeList允许添加非Attribute对象。 - 抛出:
-
IllegalArgumentException- 如果此AttributeList包含非Attribute元素。 - 自版本:
- 1.6
-
add
将指定的Attribute作为列表的最后一个元素添加。- 参数:
-
object- 要添加的属性。
-
add
在指定位置插入指定的属性作为元素。索引大于或等于当前位置的元素将向上移动。如果索引超出范围(index < 0 || index > size()),应引发RuntimeOperationsException,包装java.lang.IndexOutOfBoundsException异常。- 参数:
-
index- 要插入新Attribute对象的列表中的位置。 -
object- 要插入的Attribute对象。
-
set
将指定位置的元素设置为指定的属性。丢弃该位置上的先前元素。如果索引超出范围(index < 0 || index > size()),应引发RuntimeOperationsException,包装java.lang.IndexOutOfBoundsException异常。- 参数:
-
index- 指定的位置。 -
object- 要设置为属性元素的值。
-
addAll
将指定的AttributeList中的所有元素追加到列表的末尾,顺序与指定AttributeList的迭代器返回的顺序相同。- 参数:
-
list- 要插入到列表中的元素。 - 返回:
- 如果此调用导致列表更改,则返回true。
- 另请参见:
-
addAll
将指定的AttributeList中的所有元素插入到此列表中,从指定位置开始,顺序与指定AttributeList的迭代器返回的顺序相同。如果索引超出范围(index < 0 || index > size()),应引发RuntimeOperationsException,包装java.lang.IndexOutOfBoundsException异常。- 参数:
-
index- 要插入指定AttributeList中第一个元素的位置。 -
list- 要插入到列表中的元素。 - 返回:
- 如果此调用导致列表更改,则返回true。
- 另请参见:
-
add
将指定的元素追加到列表的末尾。- 指定者:
-
add在接口Collection<Object>中 - 指定者:
-
add在接口List<Object>中 - 覆盖:
-
add在类ArrayList<Object>中 - 参数:
-
element- 要追加到此列表的元素 - 返回值:
-
true(如Collection.add(E)中所指定) - 抛出:
-
IllegalArgumentException- 如果此AttributeList是类型安全的,并且element不是Attribute。
-
add
在列表中的指定位置插入指定的元素。将当前在该位置的元素(如果有)和任何后续元素向右移动(将它们的索引加一)。 -
addAll
将指定集合中的所有元素追加到此列表的末尾,按照指定集合的迭代器返回的顺序。如果在操作进行时修改了指定集合,则此操作的行为是未定义的。(这意味着如果指定集合是此列表,并且此列表非空,则此调用的行为是未定义的。) -
addAll
将指定集合中的所有元素插入到此列表中,从指定位置开始。将当前在该位置的元素(如果有)和任何后续元素向右移动(增加它们的索引)。新元素将按照指定集合的迭代器返回的顺序出现在列表中。 -
set
用指定元素替换此列表中指定位置的元素。
-