APIdia Launch Partner
Top Description Fields Constructors Methods
javax.management

public Class AttributeList

extends ArrayList<Object>
Class Inheritance
Imports
java.util.ArrayList, .Collection, .LinkedHashMap, .List, .Map

Represents a list of values for attributes of an MBean. See the getAttributes and setAttributes methods of MBeanServer and MBeanServerConnection.

It is not permitted to add objects to an AttributeList that are not instances of Attribute. This will produce an IllegalArgumentException when calling methods in this class, or when using listIterator and add or set.

Since
1.5

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
AttributeList()

Constructs an empty AttributeList.

public
AttributeList(int
the initial capacity of the AttributeList, as specified by ArrayList#ArrayList(int).
initialCapacity
)

Constructs an empty AttributeList with the initial capacity specified.

public
AttributeList(AttributeList
the AttributeList that defines the initial contents of the new 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.

public
AttributeList(List<Attribute>
the List that defines the initial contents of the new AttributeList.
list
)

Constructs an AttributeList containing the elements of the List specified, in the order in which they are returned by the List's iterator.

Method Summary

Modifier and TypeMethod and Description
public void
add(Attribute
The attribute to be added.
object
)

Overrides java.util.ArrayList.add.

Implements java.util.List.add, java.util.Collection.add.

Adds the Attribute specified as the last element of the list.

public void
add(int
The position in the list where the new Attribute object is to be inserted.
index
,
Attribute
The Attribute object to be inserted.
object
)

Overrides java.util.ArrayList.add.

Implements java.util.List.add.

Inserts the attribute specified as an element at the position specified.

public boolean
add(Object element)

Overrides java.util.ArrayList.add.

Implements java.util.List.add, java.util.Collection.add.

Appends the specified element to the end of this list.

public void
add(int index, Object element)

Overrides java.util.ArrayList.add.

Implements java.util.List.add.

Inserts the specified element at the specified position in this list.

public boolean

Returns:

true if this list changed as a result of the call.
addAll
(AttributeList
Elements to be inserted into the list.
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.

public boolean

Returns:

true if this list changed as a result of the call.
addAll
(int
Position at which to insert the first element from the AttributeList specified.
index
,
AttributeList
Elements to be inserted into the list.
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.

public boolean
addAll(Collection<?> c)

Overrides java.util.ArrayList.addAll.

Implements java.util.List.addAll, java.util.Collection.addAll.

Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's Iterator.

public boolean
addAll(int index, Collection<?> c)

Overrides java.util.ArrayList.addAll.

Implements java.util.List.addAll.

Inserts all of the elements in the specified collection into this list, starting at the specified position.

private void
private void
public List<Attribute>

Returns:

a List<Attribute> whose contents reflect the contents of this AttributeList.
asList
()

Return a view of this list as a List<Attribute>.

public void
set(int
The position specified.
index
,
Attribute
The value to which the attribute element should be set.
object
)

Overrides java.util.ArrayList.set.

Implements java.util.List.set.

Sets the element at the position specified to be the attribute specified.

public Object
set(int index, Object element)

Overrides java.util.ArrayList.set.

Implements java.util.List.set.

Replaces the element at the specified position in this list with the specified element.

Inherited from java.util.ArrayList:
addFirstaddLastclearclonecontainsensureCapacityequalsforEachgetgetFirstgetLasthashCodeindexOfisEmptyiteratorlastIndexOflistIteratorlistIteratorremoveremoveremoveAllremoveFirstremoveIfremoveLastremoveRangereplaceAllretainAllsizesortspliteratorsubListtoArraytoArraytrimToSize

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.ArrayList.serialVersionUID.

Constructor Detail

AttributeListback to summary
public AttributeList()

Constructs an empty AttributeList.

AttributeListback to summary
public AttributeList(int initialCapacity)

Constructs an empty AttributeList with the initial capacity specified.

Parameters
initialCapacity:int

the initial capacity of the AttributeList, as specified by ArrayList#ArrayList(int).

AttributeListback to summary
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.

Parameters
list:AttributeList

the AttributeList that defines the initial contents of the new AttributeList.

See Also
ArrayList#ArrayList(java.util.Collection)
AttributeListback to summary
public AttributeList(List<Attribute> list)

Constructs an AttributeList containing the elements of the List specified, in the order in which they are returned by the List's iterator.

Parameters
list:List<Attribute>

the List that defines the initial contents of the new AttributeList.

Exceptions
IllegalArgumentException:
if the list parameter is null or if the list parameter contains any non-Attribute objects.
Since
1.6
See Also
ArrayList#ArrayList(java.util.Collection)

Method Detail

addback to summary
public void add(Attribute object)

Overrides java.util.ArrayList.add.

Implements java.util.List.add, java.util.Collection.add.

Adds the Attribute specified as the last element of the list.

Parameters
object:Attribute

The attribute to be added.

addback to summary
public void add(int index, Attribute object)

Overrides java.util.ArrayList.add.

Implements java.util.List.add.

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
index:int

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

object:Attribute

The Attribute object to be inserted.

addback to summary
public boolean add(Object element)

Overrides java.util.ArrayList.add.

Implements java.util.List.add, java.util.Collection.add.

Doc from java.util.ArrayList.add.

Appends the specified element to the end of this list.

Annotations
@Override
Exceptions
IllegalArgumentException:
if element is not an Attribute.
addback to summary
public void add(int index, Object element)

Overrides java.util.ArrayList.add.

Implements java.util.List.add.

Doc from java.util.ArrayList.add.

Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Annotations
@Override
Exceptions
IllegalArgumentException:
if element is not an Attribute.
addAllback to summary
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:AttributeList

Elements to be inserted into the list.

Returns:boolean

true if this list changed as a result of the call.

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

Position at which to insert the first element from the AttributeList specified.

list:AttributeList

Elements to be inserted into the list.

Returns:boolean

true if this list changed as a result of the call.

See Also
ArrayList#addAll(int, java.util.Collection)
addAllback to summary
public boolean addAll(Collection<?> c)

Overrides java.util.ArrayList.addAll.

Implements java.util.List.addAll, java.util.Collection.addAll.

Doc from java.util.ArrayList.addAll.

Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's Iterator. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this list, and this list is nonempty.)

Annotations
@Override
Exceptions
IllegalArgumentException:
if c contains an element that is not an Attribute.
addAllback to summary
public boolean addAll(int index, Collection<?> c)

Overrides java.util.ArrayList.addAll.

Implements java.util.List.addAll.

Doc from java.util.ArrayList.addAll.

Inserts all of the elements in the specified collection into this list, starting at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in the list in the order that they are returned by the specified collection's iterator.

Annotations
@Override
Exceptions
IllegalArgumentException:
if c contains an element that is not an Attribute.
addingback to summary
private void adding(Object x)
addingback to summary
private void adding(Collection<?> c)
asListback to summary
public List<Attribute> asList()

Return a view of this list as a List<Attribute>. Changes to the returned value are reflected by changes to the original AttributeList and vice versa.

Returns:List<Attribute>

a List<Attribute> whose contents reflect the contents of this AttributeList.

Annotations
@SuppressWarnings:unchecked
Exceptions
IllegalArgumentException:
if this AttributeList contains an element that is not an Attribute.
Since
1.6
setback to summary
public void set(int index, Attribute object)

Overrides java.util.ArrayList.set.

Implements java.util.List.set.

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
index:int

The position specified.

object:Attribute

The value to which the attribute element should be set.

setback to summary
public Object set(int index, Object element)

Overrides java.util.ArrayList.set.

Implements java.util.List.set.

Doc from java.util.ArrayList.set.

Replaces the element at the specified position in this list with the specified element.

Annotations
@Override
Exceptions
IllegalArgumentException:
if element is not an Attribute.