站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Java Platform, Enterprise Edition v1.4 API Specifications

AttributeList (Java 2 Platform Ent. Ed. v1.4) - Java Platform, Enterprise Edition v1.4 API Specifications

JavaTM 2 Platform
Ent. Ed. v1.4

javax.management
Class AttributeList

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.ArrayList
              extended byjavax.management.AttributeList
All Implemented Interfaces:
Cloneable, Collection, List, RandomAccess, Serializable

public class AttributeList
extends 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.

See Also:
Serialized Form

Field Summary
 
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
 
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 AttributeList.


AttributeList

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

Parameters:
initialCapacity - the initial capacity of the AttributeList, as specified by ArrayList.ArrayList(int).

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.

Parameters:
list - the AttributeList that defines the initial contents of the new AttributeList.
See Also:
ArrayList.ArrayList(java.util.Collection)
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.

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.

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.
Returns:
true if this list changed as a result of the call.
See Also:
ArrayList.addAll(java.util.Collection)

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.
Returns:
true if this list changed as a result of the call.
See Also:
ArrayList.addAll(int, java.util.Collection)

JavaTM 2 Platform
Ent. Ed. v1.4

Submit a bug or feature

Copyright 2003 Sun Microsystems, Inc. All rights reserved.