javax.management

Class AttributeList

Implemented Interfaces:
Cloneable, Collection<E>, Iterable<E>, List<E>, RandomAccess, Serializable

public class AttributeList
extends ArrayList<E>

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<E>

modCount

Constructor Summary

AttributeList()
Constructs an empty list with an initial capacity of ten.
AttributeList(int capacity)
Constructs an empty list with the specified initial capacity.
AttributeList(AttributeList list)
Constructs an AttributeList using the contents of an existing list.

Method Summary

void
add(int index, Attribute attribute)
Adds the specified Attribute at the supplied index.
void
add(Attribute attribute)
Adds the specified Attribute to the end of the list.
boolean
addAll(int index, AttributeList list)
Adds all the Attributes from the supplied list to this list, at the specified 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.
void
set(int index, Attribute attribute)
Replaces the attribute at the specified index with the one supplied.

Methods inherited from class java.util.ArrayList<E>

T[] toArray, add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, trimToSize

Methods inherited from class java.util.AbstractList<E>

add, add, addAll, clear, equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList

Methods inherited from class java.util.AbstractCollection<E>

T[] toArray, add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

AttributeList

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

AttributeList

public AttributeList(int capacity)
Constructs an empty list with the specified initial capacity.
Parameters:
capacity - the initial capacity of the list.

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)

Method Details

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

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)

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

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:
java.util.ArrayList.addAll(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 <320 or index > size()
See Also:
java.util.ArrayList.set(int, Object)

AttributeList.java -- A list of MBean attributes. Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.