站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.5.0, Java 2 SDK 英文文档

AttributeList (Java 2 Platform SE 5.0) - JDK 5 Documentation v1.5.0, Java 2 SDK 英文文档

JavaTM 2 Platform
Standard Ed. 5.0

javax.management
Class AttributeList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by javax.management.AttributeList
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess

public class AttributeList
extends ArrayList

Represents a list of values for attributes of an MBean. The methods used for the insertion of Attribute objects in the AttributeList overrides the corresponding methods in the superclass ArrayList. This is needed in order to insure that the objects contained in the AttributeList are only Attribute objects. This avoids getting an exception when retrieving elements from the AttributeList.

Since:
1.5
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
AttributeList()
          Constructs an empty AttributeList.
AttributeList(AttributeList list)
          Constructs an AttributeList containing the elements of the AttributeList specified, in the order in which they are returned by the AttributeList's iterator.
AttributeList(int initialCapacity)
          Constructs an empty AttributeList with the initial capacity specified.
 
Method Summary
 void add(Attribute object)
          Adds the Attribute specified as the last element of the list.
 void add(int index, Attribute object)
          Inserts the attribute specified as an element at the position specified.
 boolean addAll(AttributeList list)
          Appends all the elements in the AttributeList specified to the end of the list, in the order in which they are returned by the Iterator of the AttributeList specified.
 boolean addAll(int index, AttributeList list)
          Inserts all of the elements in the AttributeList specified into this list, starting at the specified position, in the order in which they are returned by the Iterator of the AttributeList specified.
 void set(int index, Attribute object)
          Sets the element at the position specified to be the attribute specified.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

AttributeList

public AttributeList()
Constructs an empty AttributeList.


AttributeList

public AttributeList(int initialCapacity)
Constructs an empty AttributeList with the initial capacity specified.

Parameters:
initialCapacity - the initial capacity of the AttributeList, as specified by ArrayList.ArrayList(int).

AttributeList

public AttributeList(AttributeList list)
Constructs an AttributeList containing the elements of the AttributeList specified, in the order in which they are returned by the AttributeList's iterator. The AttributeList instance has an initial capacity of 110% of the size of the AttributeList specified.

Parameters:
list - the AttributeList that defines the initial contents of the new AttributeList.
See Also:
ArrayList.ArrayList(java.util.Collection)
Method Detail

add

public void add(Attribute object)
Adds the Attribute specified as the last element of the list.

Parameters:
object - The attribute to be added.

add

public void add(int index,
                Attribute object)
Inserts the attribute specified as an element at the position specified. Elements with an index greater than or equal to the current position are shifted up. If the index is out of range (index < 0 || index > size() a RuntimeOperationsException should be raised, wrapping the java.lang.IndexOutOfBoundsException thrown.

Parameters:
object - The Attribute object to be inserted.
index - The position in the list where the new Attribute object is to be inserted.

set

public void set(int index,
                Attribute object)
Sets the element at the position specified to be the attribute specified. The previous element at that position is discarded. If the index is out of range (index < 0 || index > size() a RuntimeOperationsException should be raised, wrapping the java.lang.IndexOutOfBoundsException thrown.

Parameters:
object - The value to which the attribute element should be set.
index - The position specified.

addAll

public boolean addAll(AttributeList list)
Appends all the elements in the AttributeList specified to the end of the list, in the order in which they are returned by the Iterator of the AttributeList specified.

Parameters:
list - Elements to be inserted into the list.
Returns:
true if this list changed as a result of the call.
See Also:
ArrayList.addAll(java.util.Collection)

addAll

public boolean addAll(int index,
                      AttributeList list)
Inserts all of the elements in the AttributeList specified into this list, starting at the specified position, in the order in which they are returned by the Iterator of the AttributeList specified. If the index is out of range (index < 0 || index > size() a RuntimeOperationsException should be raised, wrapping the java.lang.IndexOutOfBoundsException thrown.

Parameters:
list - Elements to be inserted into the list.
index - Position at which to insert the first element from the AttributeList specified.
Returns:
true if this list changed as a result of the call.
See Also:
ArrayList.addAll(int, java.util.Collection)

JavaTM 2 Platform
Standard Ed. 5.0

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.