FileDocCategorySizeDatePackage
RoleUnresolvedList.javaAPI DocJava SE 6 API10767Tue Jun 10 00:26:18 BST 2008javax.management.relation

RoleUnresolvedList

public class RoleUnresolvedList extends ArrayList
A RoleUnresolvedList represents a list of RoleUnresolved objects, representing roles not retrieved from a relation due to a problem encountered when trying to access (read or write) the roles.
since
1.5

Fields Summary
private transient boolean
typeSafe
private transient boolean
tainted
private static final long
serialVersionUID
Constructors Summary
public RoleUnresolvedList()
Constructs an empty RoleUnresolvedList.


    //
    // Constructors
    //

             
      
	super();
    
public RoleUnresolvedList(int initialCapacity)
Constructs an empty RoleUnresolvedList with the initial capacity specified.

param
initialCapacity initial capacity

	super(initialCapacity);
    
public RoleUnresolvedList(List list)
Constructs a {@code RoleUnresolvedList} containing the elements of the {@code List} specified, in the order in which they are returned by the {@code List}'s iterator. The {@code RoleUnresolvedList} instance has an initial capacity of 110% of the size of the {@code List} specified.

param
list the {@code List} that defines the initial contents of the new {@code RoleUnresolvedList}.
exception
IllegalArgumentException if the {@code list} parameter is {@code null} or if the {@code list} parameter contains any non-RoleUnresolved objects.
see
ArrayList#ArrayList(java.util.Collection)

        // Check for null parameter
        //
        if (list == null)
            throw new IllegalArgumentException("Null parameter");

        // Check for non-RoleUnresolved objects
        //
        checkTypeSafe(list);

        // Build the List<RoleUnresolved>
        //
        super.addAll(list);
    
Methods Summary
public booleanadd(java.lang.Object o)

        if (!tainted)
            tainted = isTainted(o);
        if (typeSafe)
            checkTypeSafe(o);
        return super.add(o);
    
public voidadd(int index, java.lang.Object element)

        if (!tainted)
            tainted = isTainted(element);
        if (typeSafe)
            checkTypeSafe(element);
        super.add(index, element);
    
public voidadd(javax.management.relation.RoleUnresolved role)
Adds the RoleUnresolved specified as the last element of the list.

param
role - the unresolved role to be added.
exception
IllegalArgumentException if the unresolved role is null.


	if (role == null) {
	    String excMsg = "Invalid parameter";
	    throw new IllegalArgumentException(excMsg);
	}
	super.add(role);
    
public voidadd(int index, javax.management.relation.RoleUnresolved role)
Inserts the unresolved role specified as an element at the position specified. Elements with an index greater than or equal to the current position are shifted up.

param
index - The position in the list where the new RoleUnresolved object is to be inserted.
param
role - The RoleUnresolved object to be inserted.
exception
IllegalArgumentException if the unresolved role is null.
exception
IndexOutOfBoundsException if index is out of range (index < 0 || index > size()).


	if (role == null) {
	    String excMsg = "Invalid parameter";
	    throw new IllegalArgumentException(excMsg);
	}

	super.add(index, role);
    
public booleanaddAll(java.util.Collection c)

        if (!tainted)
            tainted = isTainted(c);
        if (typeSafe)
            checkTypeSafe(c);
        return super.addAll(c);
    
public booleanaddAll(int index, java.util.Collection c)

        if (!tainted)
            tainted = isTainted(c);
        if (typeSafe)
            checkTypeSafe(c);
        return super.addAll(index, c);
    
public booleanaddAll(javax.management.relation.RoleUnresolvedList roleList)
Appends all the elements in the RoleUnresolvedList specified to the end of the list, in the order in which they are returned by the Iterator of the RoleUnresolvedList specified.

param
roleList - Elements to be inserted into the list (can be null).
return
true if this list changed as a result of the call.
exception
IndexOutOfBoundsException if accessing with an index outside of the list.


	if (roleList == null) {
	    return true;
	}

	return (super.addAll(roleList));
    
public booleanaddAll(int index, javax.management.relation.RoleUnresolvedList roleList)
Inserts all of the elements in the RoleUnresolvedList specified into this list, starting at the specified position, in the order in which they are returned by the Iterator of the RoleUnresolvedList specified.

param
index - Position at which to insert the first element from the RoleUnresolvedList specified.
param
roleList - Elements to be inserted into the list.
return
true if this list changed as a result of the call.
exception
IllegalArgumentException if the role is null.
exception
IndexOutOfBoundsException if index is out of range (index < 0 || index > size()).


	if (roleList == null) {
	    String excMsg = "Invalid parameter";
	    throw new IllegalArgumentException(excMsg);
	}

	return (super.addAll(index, roleList));
    
public java.util.ListasList()
Return a view of this list as a {@code List}. Changes to the returned value are reflected by changes to the original {@code RoleUnresolvedList} and vice versa.

return
a {@code List} whose contents reflect the contents of this {@code RoleUnresolvedList}.

If this method has ever been called on a given {@code RoleUnresolvedList} instance, a subsequent attempt to add an object to that instance which is not a {@code RoleUnresolved} will fail with an {@code IllegalArgumentException}. For compatibility reasons, a {@code RoleUnresolvedList} on which this method has never been called does allow objects other than {@code RoleUnresolved}s to be added.

throws
IllegalArgumentException if this {@code RoleUnresolvedList} contains an element that is not a {@code RoleUnresolved}.
since
1.6

        if (!typeSafe) {
            if (tainted)
                checkTypeSafe(this);
            typeSafe = true;
        }
	return (List<RoleUnresolved>) (List) this;
    
private static voidcheckTypeSafe(java.lang.Object o)
IllegalArgumentException if o is a non-RoleUnresolved object.

        try {
            o = (RoleUnresolved) o;
        } catch (ClassCastException e) {
            throw new IllegalArgumentException(e);
        }
    
private static voidcheckTypeSafe(java.util.Collection c)
IllegalArgumentException if c contains any non-RoleUnresolved objects.

        try {
            RoleUnresolved r;
            for (Object o : c)
                r = (RoleUnresolved) o;
        } catch (ClassCastException e) {
            throw new IllegalArgumentException(e);
        }
    
private static booleanisTainted(java.lang.Object o)
Returns true if o is a non-RoleUnresolved object.

        try {
            checkTypeSafe(o);
        } catch (IllegalArgumentException e) {
            return true;
        }
        return false;
    
private static booleanisTainted(java.util.Collection c)
Returns true if c contains any non-RoleUnresolved objects.

        try {
            checkTypeSafe(c);
        } catch (IllegalArgumentException e) {
            return true;
        }
        return false;
    
public java.lang.Objectset(int index, java.lang.Object element)

        if (!tainted)
            tainted = isTainted(element);
        if (typeSafe)
            checkTypeSafe(element);
        return super.set(index, element);
    
public voidset(int index, javax.management.relation.RoleUnresolved role)
Sets the element at the position specified to be the unresolved role specified. The previous element at that position is discarded.

param
index - The position specified.
param
role - The value to which the unresolved role element should be set.
exception
IllegalArgumentException if the unresolved role is null.
exception
IndexOutOfBoundsException if index is out of range (index < 0 || index >= size()).


	if (role == null) {
	    String excMsg = "Invalid parameter";
	    throw new IllegalArgumentException(excMsg);
	}

	super.set(index, role);