com.yosokumo.core
Class Catalog

java.lang.Object
  extended by com.yosokumo.core.Catalog

public class Catalog
extends java.lang.Object

An index to all the studies on which a given user has a role. A catalog has these attributes:


Method Summary
 boolean containsStudy(java.lang.String studyIdentifier)
          Test if a study is in the catalog.
 Study getStudy(java.lang.String studyIdentifier)
          Return a study from the catalog.
 java.util.Collection<Study> getStudyCollection()
          Return all studies in the catalog as a Collection<Study>.
 java.util.Set<java.lang.String> getStudyIdentifiersSet()
          Return the identifiers of all the studies in the catalog as a Set<String>.
 java.lang.String getUserIdentifier()
          Return the user identifier.
 java.lang.String getUserName()
          Return the user name.
 boolean isEmpty()
          Return true if the catalog contains no studies.
 int size()
          Return the number of studies in the catalog.
 java.lang.String toString()
          Return a string representation of this Catalog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getUserIdentifier

public java.lang.String getUserIdentifier()
Return the user identifier.

Returns:
the identifier of the user to whom the catalog belongs. May be null.

getUserName

public java.lang.String getUserName()
Return the user name.

Returns:
the name of the user to whom the catalog belongs. May be null.

getStudy

public Study getStudy(java.lang.String studyIdentifier)
Return a study from the catalog.

Parameters:
studyIdentifier - the identifier of the Study to get from the catalog.
Returns:
null means there is no study in the catalog with the identifier specified by the parameter. non-null means that there is a study in the catalog with the identifier specified by the parameter, and the return value is the specified study.

containsStudy

public boolean containsStudy(java.lang.String studyIdentifier)
Test if a study is in the catalog.

Parameters:
studyIdentifier - the identifier of the Study to test for.
Returns:
false means there is no study in the catalog with the identifier specified by the parameter. true means that there is a study in the catalog with the identifier specified by the parameter.

size

public int size()
Return the number of studies in the catalog.

Returns:
the number of studies in the catalog.

isEmpty

public boolean isEmpty()
Return true if the catalog contains no studies.

Returns:
true if the catalog contains no studies. false otherwise.

getStudyIdentifiersSet

public java.util.Set<java.lang.String> getStudyIdentifiersSet()
Return the identifiers of all the studies in the catalog as a Set<String>. This makes it possible to iterate over the study identifiers like this:
   for (String s : catalog.getStudyIdentifiersSet())
{ process study identifier s }

Returns:
a set of the identifiers of all studies in the catalog.

getStudyCollection

public java.util.Collection<Study> getStudyCollection()
Return all studies in the catalog as a Collection<Study>. This makes it possible to iterate over all studies in the catalog like this:
   for (Study s : catalog.getStudyCollection())
   {
       process study s
   }
 

Returns:
a collection of all studies in the catalog.

toString

public java.lang.String toString()
Return a string representation of this Catalog. Note that for a study in the catalog only the study identifier and study name are represented as a string, not the entire study.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of this Catalog.