javax.management

Class AttributeList

public class AttributeList extends ArrayList<Object>

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

Since: 1.5

Constructor Summary
AttributeList()
Constructs an empty list with an initial capacity of ten.
AttributeList(AttributeList list)
Constructs an {@link 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 {@link Attribute} to the end of the list.
voidadd(int index, Attribute attribute)

Adds the specified {@link Attribute} at the supplied index.

booleanaddAll(AttributeList list)
Adds all the {@link Attribute}s from the supplied list to the end of this list, in the order they are returned by the list's {@link java.util.Iterator}.
booleanaddAll(int index, AttributeList list)

Adds all the {@link Attribute}s 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: ArrayList

AttributeList

public AttributeList(AttributeList list)
Constructs an {@link 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

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

Method Detail

add

public void add(Attribute attribute)
Adds the specified {@link 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 {@link 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

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

addAll

public boolean addAll(AttributeList list)
Adds all the {@link Attribute}s from the supplied list to the end of this list, in the order they are returned by the list's {@link java.util.Iterator}.

Parameters: list the list of attributes to add.

Returns: true if the list changed.

See Also: ArrayList

addAll

public boolean addAll(int index, AttributeList list)

Adds all the {@link Attribute}s 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 {@link 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: ArrayList

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: ArrayList

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