|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.util.security.RoleSet
This class represents a set of Roles. It makes it easy to build a UI that would allow someone to add a group of Roles to a User. It wraps a TreeSet object to enforce that only Role objects are allowed in the set and only relevant methods are available. TreeSet's contain only unique Objects (no duplicates).
Field Summary | |
private java.util.TreeSet |
set
Set to hold the Role Set |
Constructor Summary | |
RoleSet()
Constructs an empty RoleSet |
|
RoleSet(java.util.Collection roles)
Constructs a new RoleSet with specifed contents. |
Method Summary | |
boolean |
add(java.util.Collection roles)
Adds the Roles in a Collection to this RoleSet. |
boolean |
add(Role role)
Adds a Role to this RoleSet. |
boolean |
add(RoleSet roleSet)
Adds the Roles in another RoleSet to this RoleSet. |
void |
clear()
Removes all Roles from this RoleSet. |
boolean |
contains(Role role)
Checks whether this RoleSet contains a Role. |
boolean |
contains(java.lang.String roleName)
Compares by name a Role with the Roles contained in this RoleSet. |
java.util.Iterator |
elements()
Returns an Iterator for Roles in this RoleSet. |
Role |
getRole(java.lang.String roleName)
Returns a Role with the given name, if it is contained in this RoleSet. |
Role[] |
getRolesArray()
Returns an Roles[] of Roles in this RoleSet. |
boolean |
remove(Role role)
Removes a Role from this RoleSet. |
int |
size()
Returns size (cardinality) of this set. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private java.util.TreeSet set
Constructor Detail |
public RoleSet()
public RoleSet(java.util.Collection roles)
roles
- A collection of roles to be contained in the set.Method Detail |
public boolean add(Role role)
role
- A Role.public boolean add(java.util.Collection roles)
roleSet
- A Collection of Roles.public boolean add(RoleSet roleSet)
roleSet
- A RoleSet.public boolean remove(Role role)
role
- A Role.public void clear()
public boolean contains(Role role)
role
- A Role.public boolean contains(java.lang.String roleName)
roleName
- Name of Role.public Role getRole(java.lang.String roleName)
roleName
- Name of Role.public Role[] getRolesArray()
public java.util.Iterator elements()
public int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |