|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.intermine.api.profile.InterMineBag
public class InterMineBag
An object that represents a bag of objects in our database for the webapp. It is backed by an ObjectStoreBag object, but contains extra data such as name and description.
| Field Summary | |
|---|---|
protected static org.apache.log4j.Logger |
LOG
|
protected java.lang.String |
type
|
| Constructor Summary | |
|---|---|
InterMineBag(ObjectStore os,
java.lang.Integer savedBagId,
ObjectStoreWriter uosw)
Loads an InterMineBag from the UserProfile database. |
|
InterMineBag(java.lang.String name,
java.lang.String type,
java.lang.String description,
java.util.Date dateCreated,
ObjectStore os,
java.lang.Integer profileId,
ObjectStoreWriter uosw)
Constructs a new InterMineIdBag, and saves it in the UserProfile database. |
|
| Method Summary | |
|---|---|
void |
addIdsToBag(java.util.Collection<java.lang.Integer> ids,
java.lang.String type)
Add the given ids to the bag, this updates the bag contents in the database. |
void |
addIdToBag(java.lang.Integer id,
java.lang.String type)
Add the given id to the bag, this updates the bag contents in the database. he type can be a qualified or un-qualified class name. |
void |
addToBagFromQuery(Query query)
Add elements to the bag from a query, this is able to operate entirely in the database without needing to read objects into memory. |
java.lang.Object |
clone()
Create copy of bag. |
protected void |
delete()
Delete this bag from the userprofile database, bag should not be used after this method has been called. |
java.util.Set<ClassDescriptor> |
getClassDescriptors()
Return the class descriptors for the type of this bag. |
java.util.List<java.lang.Integer> |
getContentsAsIds()
Returns a List which contains the contents of this bag as Integer IDs. |
java.util.Date |
getDateCreated()
Return the creation date that was passed to the constructor. |
java.lang.String |
getDescription()
Return the description of this bag. |
java.lang.String |
getName()
Returns the value of name |
ObjectStoreBag |
getOsb()
Returns the ObjectStoreBag, so that elements can be added and removed. |
java.lang.String |
getQualifiedType()
Get the fully qualified type of this bag |
int |
getSize()
Getter for size, just to make jsp happy. |
java.lang.String |
getTitle()
The user-friendly title for this object. |
java.lang.String |
getType()
Get the type of this bag (a class from InterMine model) |
boolean |
isOfType(java.lang.String testType)
Test whether the given type can be added to this bag, type can be a qualified or un-qualified string. |
void |
removeIdFromBag(java.lang.Integer id)
Remove the given id from the bag, this updates the bag contents in the database |
void |
removeIdsFromBag(java.util.Collection<java.lang.Integer> ids)
Remove the given ids from the bag, this updates the bag contents in the database |
void |
setDate(java.util.Date date)
Sets date when bag was created. |
void |
setDescription(java.lang.String description)
|
void |
setName(java.lang.String name)
Set the value of name |
void |
setProfileId(java.lang.Integer profileId)
Sets the profileId - moves this bag from one profile to another. |
int |
size()
Returns the size of the bag. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.log4j.Logger LOG
protected final java.lang.String type
| Constructor Detail |
|---|
public InterMineBag(java.lang.String name,
java.lang.String type,
java.lang.String description,
java.util.Date dateCreated,
ObjectStore os,
java.lang.Integer profileId,
ObjectStoreWriter uosw)
throws ObjectStoreException
name - the name of the bagtype - the class of objects stored in the bagdescription - the description of the bagdateCreated - the Date when this bag was createdos - the production ObjectStoreprofileId - the ID of the user in the userprofile databaseuosw - the ObjectStoreWriter of the userprofile database
ObjectStoreException - if an error occurs
public InterMineBag(ObjectStore os,
java.lang.Integer savedBagId,
ObjectStoreWriter uosw)
throws ObjectStoreException
os - the production ObjectStoresavedBagId - the ID of the bag in the userprofile databaseuosw - the ObjectStoreWriter of the userprofile database
ObjectStoreException - if something goes wrong| Method Detail |
|---|
protected void delete()
throws ObjectStoreException
ObjectStoreException - if problem deleting bagpublic java.util.List<java.lang.Integer> getContentsAsIds()
public int size()
throws ObjectStoreException
ObjectStoreException - if something goes wrong
public int getSize()
throws ObjectStoreException
ObjectStoreException - if something goes wrongpublic ObjectStoreBag getOsb()
public void setProfileId(java.lang.Integer profileId)
throws ObjectStoreException
profileId - the ID of the new userprofile
ObjectStoreException - if something goes wrongpublic java.lang.String getName()
getName in interface WebSearchable
public void setName(java.lang.String name)
throws ObjectStoreException
name - the bag name
ObjectStoreException - if something goes wrongpublic java.lang.String getDescription()
getDescription in interface WebSearchablepublic java.util.Date getDateCreated()
public void setDescription(java.lang.String description)
throws ObjectStoreException
description - the description to set
ObjectStoreException - if something goes wrongpublic java.lang.String getType()
public java.lang.String getQualifiedType()
public java.util.Set<ClassDescriptor> getClassDescriptors()
public java.lang.String getTitle()
getTitle in interface WebSearchablepublic java.lang.Object clone()
clone in class java.lang.Objectpublic void setDate(java.util.Date date)
date - new date
public void addIdToBag(java.lang.Integer id,
java.lang.String type)
throws ObjectStoreException
id - the id to addtype - the type of ids being added
ObjectStoreException - if problem storing
public void addIdsToBag(java.util.Collection<java.lang.Integer> ids,
java.lang.String type)
throws ObjectStoreException
ids - the ids to addtype - the type of ids being added
ObjectStoreException - if problem storingpublic boolean isOfType(java.lang.String testType)
testType - type to check
public void addToBagFromQuery(Query query)
throws ObjectStoreException
query - to select object ids
ObjectStoreException - if problem storing
public void removeIdFromBag(java.lang.Integer id)
throws ObjectStoreException
id - the id to remove
ObjectStoreException - if problem storing
public void removeIdsFromBag(java.util.Collection<java.lang.Integer> ids)
throws ObjectStoreException
ids - the ids to remove
ObjectStoreException - if problem storing
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||