RoleListpublic class RoleList extends ArrayList 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. |
Fields Summary |
---|
private static final long | serialVersionUID |
Constructors Summary |
---|
public RoleList()Constructs an empty RoleList.
//
// Constructors
//
super();
return;
| public RoleList(int theInitialCapacity)Constructs an empty RoleList with the initial capacity
specified.
super(theInitialCapacity);
return;
| public RoleList(List theList)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.
if (theList == null) {
String excMsg = "Invalid parameter";
throw new IllegalArgumentException(excMsg);
}
int i = 0;
for (Iterator eltIter = theList.iterator();
eltIter.hasNext();) {
Object currElt = eltIter.next();
if (!(currElt instanceof Role)) {
StringBuffer excMsgStrB = new StringBuffer();
String excMsg = "An element is not a Role at index ";
excMsgStrB.append(excMsg);
excMsgStrB.append(i);
throw new IllegalArgumentException(excMsgStrB.toString());
}
i++;
super.add(currElt);
}
return;
|
Methods Summary |
---|
public void | add(javax.management.relation.Role theRole)Adds the Role specified as the last element of the list.
if (theRole == null) {
String excMsg = "Invalid parameter";
throw new IllegalArgumentException(excMsg);
}
super.add(theRole);
return;
| public void | add(int theIndex, javax.management.relation.Role theRole)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.
if (theRole == null) {
String excMsg = "Invalid parameter";
throw new IllegalArgumentException(excMsg);
}
super.add(theIndex, theRole);
return;
| public boolean | addAll(javax.management.relation.RoleList theRoleList)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.
if (theRoleList == null) {
return true;
}
return (super.addAll(theRoleList));
| public boolean | addAll(int theIndex, javax.management.relation.RoleList theRoleList)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.
if (theRoleList == null) {
// Revisit [cebro] Localize message
String excMsg = "Invalid parameter.";
throw new IllegalArgumentException(excMsg);
}
return (super.addAll(theIndex, theRoleList));
| public void | set(int theIndex, javax.management.relation.Role theRole)Sets the element at the position specified to be the role
specified.
The previous element at that position is discarded.
if (theRole == null) {
// Revisit [cebro] Localize message
String excMsg = "Invalid parameter.";
throw new IllegalArgumentException(excMsg);
}
super.set(theIndex, theRole);
return;
|
|