javax.management

Class AttributeList

public class AttributeList extends ArrayList<Object>

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

Since: 1.5

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
voidadd(Attribute attribute)
Adds the specified Attribute to the end of the list.
voidadd(int index, Attribute attribute)

Adds the specified Attribute at the supplied index.

booleanaddAll(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 java.util.Iterator.
booleanaddAll(int index, AttributeList list)

Adds all the Attributes from the supplied list to this list, at the specified index.

voidset(int index, Attribute attribute)
Replaces the attribute at the specified index with the one supplied.

Constructor Detail

AttributeList

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

See Also: java.util.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: java.util.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: java.util.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: java.util.ArrayList#add(int, Object)

UNKNOWN: is thrown, which wraps the @link{IndexOutOfBoundsException} from the underlying array list.

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

Parameters: list the list of attributes to add.

Returns: true if the list changed.

See Also: java.util.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 java.util.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: java.util.ArrayList#addAll(int, Collection)

UNKNOWN: is thrown, which wraps the @link{IndexOutOfBoundsException} from the underlying array list.

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: java.util.ArrayList#set(int, Object)

UNKNOWN: is thrown, which wraps the @link{IndexOutOfBoundsException} from the underlying array list.