Top Description Fields Constructors Methods
javax.management.relation

public Class RoleList

extends ArrayList<Object>
Class Inheritance
Imports
com.sun.jmx.mbeanserver.Util, java.util.ArrayList, .Collection, .List

A RoleList represents a list of roles (Role objects). It is used as parameter when creating a relation, and when trying to set several roles in a relation (via 'setRoles()' method). It is returned as part of a RoleResult, to provide roles successfully retrieved.
Since
1.5

Field Summary

Modifier and TypeField and Description
private static final long
private transient boolean
private transient boolean

Constructor Summary

AccessConstructor and Description
public
RoleList()

Constructs an empty RoleList.

public
RoleList(int
initial capacity
initialCapacity
)

Constructs an empty RoleList with the initial capacity specified.

public
RoleList(List<Role>
the List that defines the initial contents of the new RoleList.
list
)

Constructs a RoleList 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(Role
the role to be added.
role
)

Overrides java.util.ArrayList.add.

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

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

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

Overrides java.util.ArrayList.add.

Implements java.util.List.add.

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

public boolean
add(Object
element to be appended to this list
o
)

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 at which the specified element is to be inserted
index
,
Object
element to be inserted
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
(RoleList
Elements to be inserted into the list (can be null)
roleList
)

Appends all the elements in the RoleList specified to the end of the list, in the order in which they are returned by the Iterator of the RoleList 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 RoleList specified.
index
,
RoleList
Elements to be inserted into the list.
roleList
)

Inserts all of the elements in the RoleList specified into this list, starting at the specified position, in the order in which they are returned by the Iterator of the RoleList specified.

public boolean
addAll(Collection<?>
collection containing elements to be added to this list
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 at which to insert the first element from the specified collection
index
,
Collection<?>
collection containing elements to be added to this list
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.

public List<Role>

Returns:

a List<Role> whose contents reflect the contents of this RoleList.

If this method has ever been called on a given RoleList instance, a subsequent attempt to add an object to that instance which is not a Role will fail with an IllegalArgumentException. For compatibility reasons, a RoleList on which this method has never been called does allow objects other than Roles to be added.

asList
()

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

private static void
checkTypeSafe(Object o)

IllegalArgumentException if o is a non-Role object.

private static void
checkTypeSafe(Collection<?> c)

IllegalArgumentException if c contains any non-Role objects.

private static boolean
isTainted(Object o)

Returns true if o is a non-Role object.

private static boolean
isTainted(Collection<?> c)

Returns true if c contains any non-Role objects.

public void
set(int
The position specified.
index
,
Role
The value to which the role element should be set.
role
)

Overrides java.util.ArrayList.set.

Implements java.util.List.set.

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

public Object
set(int
index of the element to replace
index
,
Object
element to be stored at the specified position
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.

taintedback to summary
private transient boolean tainted
typeSafeback to summary
private transient boolean typeSafe

Constructor Detail

RoleListback to summary
public RoleList()

Constructs an empty RoleList.

RoleListback to summary
public RoleList(int initialCapacity)

Constructs an empty RoleList with the initial capacity specified.

Parameters
initialCapacity:int

initial capacity

RoleListback to summary
public RoleList(List<Role> list) throws IllegalArgumentException

Constructs a RoleList containing the elements of the List specified, in the order in which they are returned by the List's iterator. The RoleList instance has an initial capacity of 110% of the size of the List specified.

Parameters
list:List<Role>

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

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

Method Detail

addback to summary
public void add(Role role) throws IllegalArgumentException

Overrides java.util.ArrayList.add.

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

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

Parameters
role:Role

the role to be added.

Returns:void

Doc from java.util.ArrayList.add.

true (as specified by Collection#add)

Exceptions
IllegalArgumentException:
if the role is null.
addback to summary
public void add(int index, Role role) throws IllegalArgumentException, IndexOutOfBoundsException

Overrides java.util.ArrayList.add.

Implements java.util.List.add.

Inserts the role specified as an element at the position specified. Elements with an index greater than or equal to the current position are shifted up.

Parameters
index:int

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

role:Role

The Role object to be inserted.

Exceptions
IllegalArgumentException:
if the role is null.
IndexOutOfBoundsException:
if accessing with an index outside of the list.
addback to summary
public boolean add(Object o)

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.

Parameters
o:Object

element to be appended to this list

Returns:boolean

true (as specified by Collection#add)

Annotations
@Override
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).

Parameters
index:int

index at which the specified element is to be inserted

element:Object

element to be inserted

Annotations
@Override
addAllback to summary
public boolean addAll(RoleList roleList) throws IndexOutOfBoundsException

Appends all the elements in the RoleList specified to the end of the list, in the order in which they are returned by the Iterator of the RoleList specified.

Parameters
roleList:RoleList

Elements to be inserted into the list (can be null)

Returns:boolean

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

Exceptions
IndexOutOfBoundsException:
if accessing with an index outside of the list.
See Also
ArrayList#addAll(Collection)
addAllback to summary
public boolean addAll(int index, RoleList roleList) throws IllegalArgumentException, IndexOutOfBoundsException

Inserts all of the elements in the RoleList specified into this list, starting at the specified position, in the order in which they are returned by the Iterator of the RoleList specified.

Parameters
index:int

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

roleList:RoleList

Elements to be inserted into the list.

Returns:boolean

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

Exceptions
IllegalArgumentException:
if the role is null.
IndexOutOfBoundsException:
if accessing with an index outside of the list.
See Also
ArrayList#addAll(int, 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.)

Parameters
c:Collection<?>

collection containing elements to be added to this list

Returns:boolean

true if this list changed as a result of the call

Annotations
@Override
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.

Parameters
index:int

index at which to insert the first element from the specified collection

c:Collection<?>

collection containing elements to be added to this list

Returns:boolean

true if this list changed as a result of the call

Annotations
@Override
asListback to summary
public List<Role> asList()

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

Returns:List<Role>

a List<Role> whose contents reflect the contents of this RoleList.

If this method has ever been called on a given RoleList instance, a subsequent attempt to add an object to that instance which is not a Role will fail with an IllegalArgumentException. For compatibility reasons, a RoleList on which this method has never been called does allow objects other than Roles to be added.

Annotations
@SuppressWarnings:unchecked
Exceptions
IllegalArgumentException:
if this RoleList contains an element that is not a Role.
Since
1.6
checkTypeSafeback to summary
private static void checkTypeSafe(Object o)

IllegalArgumentException if o is a non-Role object.

checkTypeSafeback to summary
private static void checkTypeSafe(Collection<?> c)

IllegalArgumentException if c contains any non-Role objects.

isTaintedback to summary
private static boolean isTainted(Object o)

Returns true if o is a non-Role object.

isTaintedback to summary
private static boolean isTainted(Collection<?> c)

Returns true if c contains any non-Role objects.

setback to summary
public void set(int index, Role role) throws IllegalArgumentException, IndexOutOfBoundsException

Overrides java.util.ArrayList.set.

Implements java.util.List.set.

Sets the element at the position specified to be the role specified. The previous element at that position is discarded.

Parameters
index:int

The position specified.

role:Role

The value to which the role element should be set.

Returns:void

Doc from java.util.ArrayList.set.

the element previously at the specified position

Exceptions
IllegalArgumentException:
if the role is null.
IndexOutOfBoundsException:
if accessing with an index outside of the list.
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.

Parameters
index:int

index of the element to replace

element:Object

element to be stored at the specified position

Returns:Object

the element previously at the specified position

Annotations
@Override