2.17.2: 2011-06-17

net.sf.basedb.core
Class LabeledExtract

java.lang.Object
  extended by net.sf.basedb.core.BasicItem<D>
      extended by net.sf.basedb.core.OwnedItem<D>
          extended by net.sf.basedb.core.SharedItem<D>
              extended by net.sf.basedb.core.CommonItem<D>
                  extended by net.sf.basedb.core.AnnotatedItem<D>
                      extended by net.sf.basedb.core.BioMaterial<D>
                          extended by net.sf.basedb.core.MeasuredBioMaterial<LabeledExtractData>
                              extended by net.sf.basedb.core.LabeledExtract
All Implemented Interfaces:
AccessControlled, Annotatable, Identifiable, Nameable, Ownable, Registered, Removable, Shareable

public class LabeledExtract
extends MeasuredBioMaterial<LabeledExtractData>

This class is used to represent labeled extract items. A labeled extract is an Extract that has been marked with a Label. It is also possible to create a labled extract by combining other labeled extracts, or as a standalone item with no reference to an extract or other labeled extracts.

Version:
2.0
Author:
Nicklas
Last modified
$Date: 2010-12-02 14:35:04 +0100 (Thu, 02 Dec 2010) $

Field Summary
static Item TYPE
          The type of item represented by this class.
 
Fields inherited from class net.sf.basedb.core.BioMaterial
MAX_EXTERNAL_ID_LENGTH
 
Fields inherited from interface net.sf.basedb.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
 
Constructor Summary
LabeledExtract(LabeledExtractData labeledExtractData)
           
 
Method Summary
 long countChildren(boolean pooled)
          Count the number of child labeled extracts.
 long countLabeledExtracts()
          Counts all labeled extracts that have been created from this labeled extract.
 Set<Annotatable> getAnnotatableParents()
          Get the extract or pooled labeled extracts.
static LabeledExtract getById(DbControl dc, int id)
          Get a LabeledExtract item when you know the id.
 ItemQuery<LabeledExtract> getChildLabeledExtracts()
          Creates a query that returns all child (pooled) labeled extracts that has this labeled extracts as one of it's sources.
 Extract getExtract()
          Get the Extract that is the parent of this labeled extract.
 ItemQuery<Hybridization> getHybridizations()
          Get a query that returns all hybridizations created from this labeled extract.
 Label getLabel()
          Get the Label compound used for labeling the extract.
static LabeledExtract getNew(DbControl dc, Label label)
          Create a new LabeledExtract item.
static LabeledExtract getNew(DbControl dc, Label label, BioPlateEventParticipant master)
          Create a new LabeledExtract item as part of a master bioplate event.
static ItemQuery<LabeledExtract> getQuery()
          Get a query that returns labeled extracts.
 Item getType()
          Get the type of item represented by the object.
 Set<ItemProxy> getUsingItems()
          Get all: Hybridization:s created from this labeled extract
 boolean isUsed()
          Check that: no Hybridization:s has been created from this item no LabeledExtract:s has been created from this item
 void setExtract(Extract extract, Float usedQuantity)
          Set the Extract item that is the parent of this labeled extract.
 void setLabel(Label label)
          Set the Label that was used to label the extract.
 
Methods inherited from class net.sf.basedb.core.MeasuredBioMaterial
getBioWell, getCreationEvent, getEntryDate, getEvents, getOriginalQuantity, getPoolingEvents, getProtocol, getRemainingQuantity, isInWell, isLockedInWell, isPooled, newEvent, newEvent, onBeforeCommit, setBioPlateEventParticipant, setBioWell, setOriginalQuantity, setPooled, updateRemainingQuantity
 
Methods inherited from class net.sf.basedb.core.BioMaterial
getExternalId, setExternalId
 
Methods inherited from class net.sf.basedb.core.AnnotatedItem
getAnnotationSet, isAnnotated, removeAnnotations, toTransferable
 
Methods inherited from class net.sf.basedb.core.CommonItem
getDescription, getName, isRemoved, setDescription, setName, setRemoved, toTransferable
 
Methods inherited from class net.sf.basedb.core.SharedItem
getItemKey, getProjectKey, initPermissions, isShared, setItemKey, setProjectKey, toTransferable
 
Methods inherited from class net.sf.basedb.core.OwnedItem
getOwner, isOwner, setOwner, takeOwnership, toTransferable
 
Methods inherited from class net.sf.basedb.core.BasicItem
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getVersion
 
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
 
Methods inherited from interface net.sf.basedb.core.Ownable
getOwner, isOwner, setOwner, takeOwnership
 

Field Detail

TYPE

public static final Item TYPE
The type of item represented by this class.

See Also:
Item.LABELEDEXTRACT, getType()
Constructor Detail

LabeledExtract

LabeledExtract(LabeledExtractData labeledExtractData)
Method Detail

getNew

public static LabeledExtract getNew(DbControl dc,
                                    Label label)
                             throws BaseException
Create a new LabeledExtract item.

Parameters:
dc - The DbControl which will be used for permission checking and database access
label - The labeling compound used for labeling the extract
Returns:
The new LabeledExtract item
Throws:
BaseException - If there is an error

getNew

public static LabeledExtract getNew(DbControl dc,
                                    Label label,
                                    BioPlateEventParticipant master)
                             throws BaseException
Create a new LabeledExtract item as part of a master bioplate event.

Parameters:
dc - The DbControl which will be used for permission checking and database access
label - The labeling compound used for labeling the extract
master - The master bioplate event participant or null
Returns:
The new LabeledExtract item
Throws:
BaseException - If there is an error
Since:
2.17

getById

public static LabeledExtract getById(DbControl dc,
                                     int id)
                              throws ItemNotFoundException,
                                     PermissionDeniedException,
                                     BaseException
Get a LabeledExtract item when you know the id.

Parameters:
dc - The DbControl which will be used for permission checking and database access.
id - The id of the item to load
Returns:
The LabeledExtract item
Throws:
ItemNotFoundException - If an item with the specified id is not found
PermissionDeniedException - If the logged in user doesn't have read permission to the item
BaseException - If there is another error

getQuery

public static ItemQuery<LabeledExtract> getQuery()
Get a query that returns labeled extracts.

Returns:
An ItemQuery object.

getType

public Item getType()
Description copied from interface: Identifiable
Get the type of item represented by the object. The returned value is one of the values defined in the Item enumeration.

Returns:
A value indicating the type of item

getAnnotatableParents

public Set<Annotatable> getAnnotatableParents()
                                       throws BaseException
Get the extract or pooled labeled extracts.

Returns:
A set containing annotatable items, or null
Throws:
BaseException - If there is an error

isUsed

public boolean isUsed()
               throws BaseException
Check that:

Overrides:
isUsed in class MeasuredBioMaterial<LabeledExtractData>
Returns:
TRUE if this item is used, FALSE otherwise
Throws:
BaseException - If not able to tell if item is used or not.
See Also:
BasicItem.getUsingItems()

getUsingItems

public Set<ItemProxy> getUsingItems()
Get all:

getLabel

public Label getLabel()
               throws PermissionDeniedException,
                      BaseException
Get the Label compound used for labeling the extract.

Returns:
A Label object
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission for the label
BaseException - If there is another error

setLabel

public void setLabel(Label label)
              throws PermissionDeniedException,
                     InvalidDataException
Set the Label that was used to label the extract.

Parameters:
label - The new Label item
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission for this labeled extract or use permission for the label
InvalidDataException - If the label is null
BaseException - If there is another error

getExtract

public Extract getExtract()
                   throws PermissionDeniedException,
                          BaseException
Get the Extract that is the parent of this labeled extract.

Returns:
An Extract object or null if this is a pooled or standalone labeled extract
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission for the extract
BaseException - If there is another error

setExtract

public void setExtract(Extract extract,
                       Float usedQuantity)
                throws PermissionDeniedException,
                       InvalidDataException,
                       BaseException
Set the Extract item that is the parent of this labeled extract.

Parameters:
extract - The new Extract item
usedQuantity - Used quantity of the extract.
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission for this labeled extract or use permission for the extract
InvalidDataException - If this is a pooled labeled extract
BaseException - If there is another error

getHybridizations

public ItemQuery<Hybridization> getHybridizations()
Get a query that returns all hybridizations created from this labeled extract.

Returns:
An ItemQuery object

getChildLabeledExtracts

public ItemQuery<LabeledExtract> getChildLabeledExtracts()
Creates a query that returns all child (pooled) labeled extracts that has this labeled extracts as one of it's sources.

Returns:
A query
Since:
2.10

countLabeledExtracts

public long countLabeledExtracts()
                          throws BaseException
Counts all labeled extracts that have been created from this labeled extract. The count includes labeled extracts that the logged in user doesn't have access to.

Returns:
The number of labeled extracts
Throws:
BaseException - If there is some kind of error.
Since:
2.16

countChildren

public long countChildren(boolean pooled)
Count the number of child labeled extracts. Since a labeled extract can't have non-pooled childre, this method always return 0 if pooled = false.

Specified by:
countChildren in class BioMaterial<LabeledExtractData>
Parameters:
pooled - If TRUE, the count is for biomaterials of the same type, if FALSE the count is for biomaterials of the child type
Since:
2.16

2.17.2: 2011-06-17