|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.yosokumo.core.Roster
public class Roster
For each study, a list of users that have a role on the study. A roster has these attributes:
Field Summary | |
---|---|
private java.util.Map<java.lang.String,Role> |
roleCollection
|
private java.lang.String |
rosterLocation
|
private java.lang.String |
studyIdentifier
|
private java.lang.String |
studyName
|
Constructor Summary | |
---|---|
Roster()
Initializes a newly created Roster object with default
attributes. |
|
Roster(java.lang.String studyIdentifier,
java.lang.String studyName)
Initializes a newly created Roster object with attributes
specified by the input parameters. |
Method Summary | |
---|---|
(package private) Role |
addRole(Role role)
Add a role to the roster. |
(package private) void |
clearRoles()
Remove all roles from the roster. |
boolean |
containsRole(java.lang.String userIdentifier)
Test if a role is in the roster. |
Role |
getRole(java.lang.String userIdentifier)
Return a role from the roster. |
java.util.Collection<Role> |
getRoleCollection()
Return all roles in the roster as a Collection<Role> . |
(package private) java.lang.String |
getRosterLocation()
Return the roster location. |
java.lang.String |
getStudyIdentifier()
Return the study identifier. |
java.lang.String |
getStudyName()
Return the study name. |
java.util.Set<java.lang.String> |
getUserIdentifiersSet()
Return the user identifiers of all the roles in the roster as a Set<String> . |
boolean |
isEmpty()
Return true if the roster contains no roles. |
(package private) Role |
removeRole(java.lang.String userIdentifier)
Remove a role from the roster. |
(package private) void |
setRosterLocation(java.lang.String loc)
Set the roster location. |
(package private) void |
setStudyIdentifier(java.lang.String id)
Set the study identifier. |
(package private) void |
setStudyName(java.lang.String name)
Set the study name. |
int |
size()
Return the number of roles in the roster. |
java.lang.String |
toString()
Return a string representation of this Roster . |
(package private) java.lang.String |
toStringInternal(boolean showAll)
Return a string representation of this Roster . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String studyIdentifier
private java.lang.String studyName
private java.lang.String rosterLocation
private java.util.Map<java.lang.String,Role> roleCollection
Constructor Detail |
---|
Roster()
Roster
object with default
attributes.
Roster(java.lang.String studyIdentifier, java.lang.String studyName)
Roster
object with attributes
specified by the input parameters.
studyIdentifier
- the identifier of the study the roster is for.studyName
- the name of the study the roster is for.Method Detail |
---|
void setStudyIdentifier(java.lang.String id)
id
- the identifier of the study to which the roster belongs.
May be null.public java.lang.String getStudyIdentifier()
void setStudyName(java.lang.String name)
name
- the name of the study to which the roster belongs.
May be null.public java.lang.String getStudyName()
void setRosterLocation(java.lang.String loc)
loc
- the location to assign to this roster. May be null.java.lang.String getRosterLocation()
Role addRole(Role role)
Role
parameter
is added to the roster. The return value distinguishes two
possibilities.
role
- the Role
to add to the roster.
null
means there was no role with the same user
identifier already in the roster.
non-null
means that there was a role with the same user
identifier already in the roster, and the return value is
the old role which has been replaced by the new one.Role removeRole(java.lang.String userIdentifier)
userIdentifier
- the user identifier of the Role
to
remove from the roster.
null
means there was no role in the roster with the
user identifier specified by the parameter; the roster
is left unchanged.
non-null
means that there was a role in the roster
with the user identifier specified by the parameter; the
role has been removed from the roster, and the return
value is the removed role.void clearRoles()
public Role getRole(java.lang.String userIdentifier)
userIdentifier
- the identifier of the Role
to
get from the roster.
null
means there is no role in the roster with the
user identifier specified by the parameter.
non-null
means that there is a role in the roster
with the user identifier specified by the parameter, and
the return value is the specified role.public boolean containsRole(java.lang.String userIdentifier)
userIdentifier
- the identifier of the Role
to
test for.
false
means there is no role in the roster with the
user identifier specified by the parameter.
true
means that there is a role in the roster
with the user identifier specified by the parameter.public int size()
public boolean isEmpty()
true
if the roster contains no roles.
true
if the roster contains no roles.
false
otherwise.public java.util.Set<java.lang.String> getUserIdentifiersSet()
Set<String>
. This makes it possible to iterate over the
role identifiers like this:
for (String s : roster.getUserIdentifiersSet())
{ process role identifier s }
public java.util.Collection<Role> getRoleCollection()
Collection<Role>
.
This makes it possible to iterate over all roles in the roster
like this:
for (Role r : roster.getRoleCollection()) { process role r }
public java.lang.String toString()
Roster
. Note that
for a role in the roster only the role identifier is represented
as a string, not the entire role.
toString
in class java.lang.Object
Roster
.java.lang.String toStringInternal(boolean showAll)
Roster
. Note that
for a role in the roster only the role identifier is represented
as a string, not the entire role.
showAll
- specifies if internal data members should be shown.
Roster
.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |