javax.management
Class AttributeList

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.ArrayList
                    |
                    +--javax.management.AttributeList

public class AttributeList

extends java.util.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.

Version:

1.5

Author:

Raimondo Castino

See Also:

Serialized Form

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, 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, remove, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

 

Constructor Detail

AttributeList

public AttributeList()

Constructs an empty AttributeList.

AttributeList

public AttributeList(int initialCapacity)

Constructs an empty AttributeList with the initial capacity specified.

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.

 

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.

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

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.

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