|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.yosokumo.core.Catalog
public class Catalog
An index to all the studies on which a given user has a role. A catalog has these attributes:
Field Summary | |
---|---|
private java.lang.String |
catalogLocation
URI of the catalog. |
private java.util.Map<java.lang.String,Study> |
studyCollection
Collection of studies comprising the catalog. |
private java.lang.String |
userIdentifier
Identifier of the user to whom the catalog belongs. |
private java.lang.String |
userName
User name of the user to whom the catalog belongs. |
Constructor Summary | |
---|---|
Catalog()
Initializes a newly created Catalog object with default
attributes. |
|
Catalog(java.lang.String userIdentifier,
java.lang.String userName)
Initializes a newly created Catalog object with attributes
specified by the input parameters. |
Method Summary | |
---|---|
(package private) Study |
addStudy(Study study)
Add a study to the catalog. |
(package private) void |
clearStudies()
Remove all studies from the catalog. |
boolean |
containsStudy(java.lang.String studyIdentifier)
Test if a study is in the catalog. |
(package private) static Catalog |
copyCatalog(Catalog oldCatalog)
Make a deep copy of a catalog. |
(package private) java.lang.String |
getCatalogLocation()
Return the catalog location. |
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. |
(package private) Study |
removeStudy(java.lang.String studyIdentifier)
Remove a study from the catalog. |
(package private) void |
setCatalogLocation(java.lang.String loc)
Set the catalog location. |
(package private) void |
setUserIdentifier(java.lang.String id)
Set the user identifier. |
(package private) void |
setUserName(java.lang.String name)
Set the user name. |
int |
size()
Return the number of studies in the catalog. |
java.lang.String |
toString()
Return a string representation of this Catalog . |
(package private) java.lang.String |
toStringInternal(boolean showAll)
Return a string representation of this Catalog . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String userIdentifier
private java.lang.String userName
private java.lang.String catalogLocation
private java.util.Map<java.lang.String,Study> studyCollection
Constructor Detail |
---|
Catalog()
Catalog
object with default
attributes.
Catalog(java.lang.String userIdentifier, java.lang.String userName)
Catalog
object with attributes
specified by the input parameters.
userIdentifier
- the unique identifier for the user.userName
- the name of the user.Method Detail |
---|
static Catalog copyCatalog(Catalog oldCatalog)
oldCatalog
- the catalog to copy.
void setUserIdentifier(java.lang.String id)
id
- the identifier of the user to whom the catalog belongs.
May be null.public java.lang.String getUserIdentifier()
void setUserName(java.lang.String name)
name
- the name of the user to whom the catalog belongs.
May be null.public java.lang.String getUserName()
void setCatalogLocation(java.lang.String loc)
loc
- the location of this catalog. May be null.java.lang.String getCatalogLocation()
Study addStudy(Study study)
Study
parameter
is added to the catalog. The return value distinguishes two
possibilities.
study
- the Study
to add to the catalog.
null
means there was no study with the same identifier
already in the catalog.
non-null
means that there was a study with the same
identifier already in the catalog, and the return value is
the old study which has been replaced by the new one.Study removeStudy(java.lang.String studyIdentifier)
studyIdentifier
- the identifier of the Study
to
remove from the catalog.
null
means there was no study in the catalog with the
identifier specified by the parameter; the catalog is left
unchanged.
non-null
means that there was a study in the catalog
with the identifier specified by the parameter; the study
has been removed from the catalog, and the return value is
the removed study.void clearStudies()
public Study getStudy(java.lang.String studyIdentifier)
studyIdentifier
- the identifier of the Study
to
get from the catalog.
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.public boolean containsStudy(java.lang.String studyIdentifier)
studyIdentifier
- the identifier of the Study
to
test for.
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.public int size()
public boolean isEmpty()
true
if the catalog contains no studies.
true
if the catalog contains no studies.
false
otherwise.public java.util.Set<java.lang.String> getStudyIdentifiersSet()
Set<String>
. This makes it possible to iterate over the
study identifiers like this:
for (String s : catalog.getStudyIdentifiersSet())
{ process study identifier s }
public java.util.Collection<Study> getStudyCollection()
Collection<Study>
.
This makes it possible to iterate over all studies in the catalog
like this:
for (Study s : catalog.getStudyCollection()) { process study s }
public java.lang.String toString()
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.
toString
in class java.lang.Object
Catalog
.java.lang.String toStringInternal(boolean showAll)
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.
showAll
- specifies if internal data members should be shown.
Catalog
.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |