FileDocCategorySizeDatePackage
AttributeList.javaAPI DocJava SE 5 API5371Fri Aug 26 14:57:32 BST 2005javax.management

AttributeList

public class AttributeList extends ArrayList
Represents a list of values for attributes of an MBean. The methods used for the insertion of {@link javax.management.Attribute 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

Fields Summary
private static final long
serialVersionUID
Constructors Summary
public AttributeList()
Constructs an empty AttributeList.


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

param
initialCapacity the initial capacity of the AttributeList, as specified by {@link ArrayList#ArrayList(int)}.

 
	super(initialCapacity);
    
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.

param
list the AttributeList that defines the initial contents of the new AttributeList.
see
ArrayList#ArrayList(java.util.Collection)

 
	super(list);
    
Methods Summary
public voidadd(javax.management.Attribute object)
Adds the Attribute specified as the last element of the list.

param
object The attribute to be added.

 
	super.add(object);
    
public voidadd(int index, javax.management.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.

param
object The Attribute object to be inserted.
param
index The position in the list where the new Attribute object is to be inserted.

 
	try {
	    super.add(index, object);
	}
	catch (IndexOutOfBoundsException e) {
	    throw (new RuntimeOperationsException(e, "The specified index is out of range"));
	}
    
public booleanaddAll(javax.management.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.

param
list Elements to be inserted into the list.
return
true if this list changed as a result of the call.
see
ArrayList#addAll(java.util.Collection)

 
	return (super.addAll(list));
    
public booleanaddAll(int index, javax.management.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.

param
list Elements to be inserted into the list.
param
index Position at which to insert the first element from the AttributeList specified.
return
true if this list changed as a result of the call.
see
ArrayList#addAll(int, java.util.Collection)

 
	try {
	    return(super.addAll(index, list));
	}
	catch (IndexOutOfBoundsException e) {
	    throw (new RuntimeOperationsException(e, "The specified index is out of range"));
	}
    
public voidset(int index, javax.management.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.

param
object The value to which the attribute element should be set.
param
index The position specified.

 
	try {
	    super.set(index, object);
	}
	catch (IndexOutOfBoundsException e) {
	    throw (new RuntimeOperationsException(e, "The specified index is out of range"));
	}