Last update: 2011-06-23

org.proteios.core
Class MeasuredBioMaterial<D extends MeasuredBioMaterialData>

java.lang.Object
  extended by org.proteios.core.BasicItem<D>
      extended by org.proteios.core.OwnedItem<D>
          extended by org.proteios.core.SharedItem<D>
              extended by org.proteios.core.CommonItem<D>
                  extended by org.proteios.core.AnnotatedItem<D>
                      extended by org.proteios.core.BioMaterial<D>
                          extended by org.proteios.core.MeasuredBioMaterial<D>
All Implemented Interfaces:
AccessControlled, Annotatable, Identifiable, Nameable, Ownable, Removable, Shareable
Direct Known Subclasses:
Extract, LabeledExtract, MeasuredArea, Sample

public abstract class MeasuredBioMaterial<D extends MeasuredBioMaterialData>
extends BioMaterial<D>

This class is the base class for measured biomaterial items. A measured item is an item which can have original and remaining quantities associated with them.

The core keeps track of the remaining quantity whenever an item is used to create other items. As it is, an item can be used when creating another item of the same type (pooling) or when creating an item of the appropriate subtype, ie. Sample -> Extract -> LabeledExtract.

It is also possible to add a note using a BioMaterialEvent saying that the quantity has been changed and why.

Version:
2.0
Author:
Nicklas
Last modified
$Date: 2009-04-09 08:48:11 +0200 (Thu, 09 Apr 2009) $

Field Summary
 
Fields inherited from class org.proteios.core.BioMaterial
MAX_EXTERNAL_ID_LENGTH, MAX_STORAGE_LOCATION_LENGTH
 
Fields inherited from interface org.proteios.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
 
Method Summary
 Float getConcentrationInGramsPerLiter()
          Get the concentration (in mg protein / ml) of the biomaterial.
 CreationEvent getCreationEvent()
          Get the event that represents the creation of this biomaterial.
 ItemQuery<BioMaterialEvent> getEventQuery()
           
 Set<BioMaterialEvent> getEvents()
          Get the events that have used this biomaterial.
 Float getOriginalQuantityInMicroLiters()
          Get the original quantity of the biomaterial measured in microliters.
 Float getRemainingQuantityInMicroLiters()
          Get the remaining quantity of the biomaterial measured in microliters.
 boolean isPooled()
          Check if this biomaterial was created by pooling or not.
 boolean isUsed()
          Check that: no pooled biomaterial has been created from this item
 void setConcentrationInGramsPerLiter(Float concentration)
          Set the concentration (in mg protein / ml) of the biomaterial.
 void setCreationEvent(CreationEvent creationEvent)
           
 void setOriginalQuantityInMicroLiters(Float originalQuantity)
          Set the original quantity of the biomaterial measured in microliters.
 void setPooled(boolean pooled)
          Specify if this biomaterial was created by pooling or not.
 void setRemainingQuantityInMicroLiters(Float remainingQuantity)
          Set the remaining quantity of the biomaterial measured in microliters.
 
Methods inherited from class org.proteios.core.BioMaterial
addFile, getExternalId, getFiles, getStorageLocation, setExternalId, setFiles, setStorageLocation
 
Methods inherited from class org.proteios.core.CommonItem
getDescription, getName, isRemoved, setDescription, setName, setRemoved
 
Methods inherited from class org.proteios.core.SharedItem
getItemKey, getProjectKey, isShared, setItemKey, setProjectKey
 
Methods inherited from class org.proteios.core.OwnedItem
getOwner, setOwner
 
Methods inherited from class org.proteios.core.BasicItem
checkPermission, equals, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.proteios.core.Identifiable
getId, getType, getVersion
 
Methods inherited from interface org.proteios.core.AccessControlled
checkPermission, hasPermission
 
Methods inherited from interface org.proteios.core.Ownable
getOwner, setOwner
 

Method Detail

isUsed

public boolean isUsed()
               throws BaseException
Check that:

Specified by:
isUsed in class BasicItem<D extends MeasuredBioMaterialData>
Returns:
TRUE if this item is used, FALSE otherwise
Throws:
BaseException

getCreationEvent

public CreationEvent getCreationEvent()
                               throws PermissionDeniedException,
                                      BaseException
Get the event that represents the creation of this biomaterial. Return null if no creation event registered.

Returns:
A CreationEvent data.
Throws:
PermissionDeniedException
BaseException

setCreationEvent

public void setCreationEvent(CreationEvent creationEvent)

getConcentrationInGramsPerLiter

public Float getConcentrationInGramsPerLiter()
Get the concentration (in mg protein / ml) of the biomaterial.

Returns:
A Float holding concentration, or null if not known

setConcentrationInGramsPerLiter

public void setConcentrationInGramsPerLiter(Float concentration)
Set the concentration (in mg protein / ml) of the biomaterial.

Parameters:
concentration - A Float holding concentration, or null if not known

getOriginalQuantityInMicroLiters

public Float getOriginalQuantityInMicroLiters()
Get the original quantity of the biomaterial measured in microliters.

Returns:
A Float holding the original quantity, or null if not known

setOriginalQuantityInMicroLiters

public void setOriginalQuantityInMicroLiters(Float originalQuantity)
                                      throws PermissionDeniedException,
                                             InvalidDataException,
                                             BaseException
Set the original quantity of the biomaterial measured in microliters. If the remaining quantity is null, it's value is also set to the same as the original value.

Parameters:
originalQuantity - The new value for the original quantity, or null if not known
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission
InvalidDataException - If the original quantity is below zero
BaseException

getRemainingQuantityInMicroLiters

public Float getRemainingQuantityInMicroLiters()
Get the remaining quantity of the biomaterial measured in microliters. The remaining quantity cannot be modified directly. It is calculated based on the events for this biomaterial.

Returns:
A Float holding the remaining quantity or null if not known

setRemainingQuantityInMicroLiters

public void setRemainingQuantityInMicroLiters(Float remainingQuantity)
                                       throws PermissionDeniedException,
                                              InvalidDataException,
                                              BaseException
Set the remaining quantity of the biomaterial measured in microliters.

Parameters:
remainingQuantity - The new value for the remaining quantity, or null if not known
Throws:
PermissionDeniedException - If the logged in user doesn't have use permission
InvalidDataException - If the remaining quantity is below zero
BaseException

isPooled

public boolean isPooled()
Check if this biomaterial was created by pooling or not.


setPooled

public void setPooled(boolean pooled)
               throws PermissionDeniedException,
                      BaseException
Specify if this biomaterial was created by pooling or not.

Throws:
PermissionDeniedException - If the logged in user doesn't have write permission
BaseException - If there is another error
See Also:
BioMaterialEvent.getSources()

getEvents

public Set<BioMaterialEvent> getEvents()
Get the events that have used this biomaterial.


getEventQuery

public ItemQuery<BioMaterialEvent> getEventQuery()
Returns:
a Query for all events that used this extract

Last update: 2011-06-23