javax.management
Class AttributeList

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

public class AttributeList
extends ArrayList<Object>

Represents a list of MBean Attributes, with their names and values. This is implemented as an ArrayList extension, with additional methods typed to only allow the addition of Attributes.

Since:
1.5
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
AttributeList()
          Constructs an empty list with an initial capacity of ten.
AttributeList(AttributeList list)
          Constructs an AttributeList using the contents of an existing list.
AttributeList(int capacity)
          Constructs an empty list with the specified initial capacity.
 
Method Summary
 void add(Attribute attribute)
          Adds the specified Attribute to the end of the list.
 void add(int index, Attribute attribute)
           Adds the specified Attribute at the supplied index.
 boolean addAll(AttributeList list)
          Adds all the Attributes from the supplied list to the end of this list, in the order they are returned by the list's Iterator.
 boolean addAll(int index, AttributeList list)
           Adds all the Attributes from the supplied list to this list, at the specified index.
 void set(int index, Attribute attribute)
          Replaces the attribute at the specified index with the one supplied.
 
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
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Constructor Detail

AttributeList

public AttributeList()
Constructs an empty list with an initial capacity of ten.

See Also:
ArrayList.ArrayList()

AttributeList

public AttributeList(AttributeList list)
Constructs an AttributeList using the contents of an existing list. The initial capacity is 110% of the size of the specified list.

Parameters:
list - the list to use to fill this list.
See Also:
ArrayList.ArrayList(java.util.Collection)

AttributeList

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

Parameters:
capacity - the initial capacity of the list.
See Also:
ArrayList.ArrayList(int)
Method Detail

add

public void add(Attribute attribute)
Adds the specified Attribute to the end of the list.

Parameters:
attribute - the attribute to add.
See Also:
java.util.Arraylist#add(Object)

add

public void add(int index,
                Attribute attribute)

Adds the specified Attribute at the supplied index. Any attribute already at that index is moved up one place in the list to the position (index + 1). Likewise, the attribute at (index + 1) is also moved up one place, continuing until the final attribute in the list moves to a new position, increasing the size of the list.

If the index is invalid (i.e. it is smaller than zero, or greater than the current size of the list), a

Parameters:
index - the index at which to place the new attribute.
attribute - the new attribute to add.
Throws:
RuntimeOperationsException - if index < 0 or index > size()
See Also:
ArrayList.add(int, Object)

addAll

public boolean addAll(AttributeList list)
Adds all the Attributes from the supplied list to the end of this list, in the order they are returned by the list's Iterator.

Parameters:
list - the list of attributes to add.
Returns:
true if the list changed.
See Also:
ArrayList.addAll(Collection)

addAll

public boolean addAll(int index,
                      AttributeList list)

Adds all the Attributes from the supplied list to this list, at the specified index. The attributes are added in the order they are returned by the list's Iterator. Any attribute already at that index is moved up one place in the list to the position (index + list.size()). Likewise, the attribute at (index + list.size()) is also moved up one place, continuing until the final attribute in the original list.

If the index is invalid (i.e. it is smaller than zero, or greater than the current size of the list), a

Parameters:
index - the index at which to place the new attribute.
list - the list of attributes to add.
Returns:
true if the list changed.
Throws:
RuntimeOperationsException - if index < 0 or index > size()
See Also:
ArrayList.addAll(int, Collection)

set

public void set(int index,
                Attribute attribute)
Replaces the attribute at the specified index with the one supplied. If the index is invalid (i.e. it is smaller than zero, or greater than the current size of the list), a

Parameters:
index - the index at which to place the new attribute.
attribute - the new attribute to add.
Throws:
RuntimeOperationsException - if index < 0 or index > size()
See Also:
ArrayList.set(int, Object)