Package net.sf.basedb.core
Class BioWell
- java.lang.Object
-
- net.sf.basedb.core.BasicItem
-
- net.sf.basedb.core.ChildItem
-
- net.sf.basedb.core.BioWell
-
- All Implemented Interfaces:
AccessControlled
,Identifiable
public class BioWell extends ChildItem
A biowell is located on aBioPlate
and contains aMeasuredBioMaterial
. The item holds information about witch row and column it is located on the bio plate.- Version:
- 2.10
- Author:
- Martin
- See Also:
BioPlate
- Last modified
- $Date: 2008-11-27 16:33:55 +0100 (Thu, 27 Nov 2008) $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BioWell.LockMode
The lock mode for a well is determined by the plate's bio plate type.
-
Constructor Summary
Constructors Constructor Description BioWell(BioWellData data)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canAddBioMaterial()
Check if it is possible to add/change biomaterial in this well.boolean
canClearBioMaterial()
Check if it is possible to clear the current biomaterial in this well.MeasuredBioMaterial
getBioMaterial()
Gets theMeasuredBioMaterial
connected to this biowell.Item
getBioMaterialType()
Get the type of biomaterial that is placed in this well.static BioWell
getById(DbControl dc, int id)
Get aBioWell
item when you know the id.int
getColumn()
Gets the column index where this well is located.String
getCoordinate()
Get a string representation of the coordinate for this well.(package private) BioWellData
getData()
Get theBasicData
object that holds all data for this item.BioWell.LockMode
getLockMode()
Get the lock mode of this well.MeasuredBioMaterial
getOriginalBioMaterial()
Get the original biomaterial that was placed in this biowell.BioPlate
getPlate()
Get theBioPlate
this biowell belongs to.PlateCoordinate
getPlateCoordinate()
Get the plate coordinate representation of the coordinate for this well.static ItemQuery<BioWell>
getQuery(BioPlate bioPlate)
Get a query configured to retrieve wells for a plate.int
getRow()
Gets the row index where this well is located.(package private) SharedData
getSharedParent()
Get the shareable parent item of this child item.Item
getType()
Get the type of item represented by the object.Set<ItemProxy>
getUsingItems()
Adds theMeasuredBioMaterial
,used in this well, to the Set.boolean
hasBeenUsed()
If the original biomaterial in this well has been moved to another plate (eg. for final storage in a freezer).boolean
isEmpty()
Is this well empty?boolean
isUsed()
Check if aMeasuredBioMaterial
is linked to this bio-well-
Methods inherited from class net.sf.basedb.core.ChildItem
getPermissionForUse, getPermissionForWriteDeleteAndCreate, getPluginPermissions, initPermissions
-
Methods inherited from class net.sf.basedb.core.BasicItem
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
-
-
-
-
Field Detail
-
TYPE
public static final Item TYPE
The type of item represented by this class.- See Also:
Item.BIOWELL
,getType()
-
-
Constructor Detail
-
BioWell
BioWell(BioWellData data)
-
-
Method Detail
-
getById
public static BioWell getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Get aBioWell
item when you know the id.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database access.id
- The id of the item to load- Returns:
- The
BioWell
item - Throws:
ItemNotFoundException
- If an item with the specified id is not foundPermissionDeniedException
- If the logged in user doesn't havePermission.READ
permission to the itemBaseException
- If there is another error
-
getQuery
public static ItemQuery<BioWell> getQuery(BioPlate bioPlate) throws InvalidDataException
Get a query configured to retrieve wells for a plate. A plate is always required, but if a null bioplate parameter is used the query will include a parameter "bioPlate" that must be set before the query is actuall executed. The gain is that the same query can be re-used with multiple plates.- Parameters:
bioPlate
- The plate to retreive wells for, null is allowed but a bioplate must be set for the "bioPlate" query parameter before the query is executed- Returns:
- An
ItemQuery
object - Throws:
InvalidDataException
- See Also:
Plate.getEvents()
-
getData
BioWellData getData()
Description copied from class:BasicItem
Get theBasicData
object that holds all data for this item.
-
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 theItem
enumeration.- Returns:
- A value indicating the type of item
-
getUsingItems
public Set<ItemProxy> getUsingItems()
Adds theMeasuredBioMaterial
,used in this well, to the Set.- Overrides:
getUsingItems
in classBasicItem
- Returns:
- A set containing proxies for the items, or an empty set if no items are using this item
- See Also:
BasicItem.addUsingItems(Set, Item, org.hibernate.query.Query)
-
isUsed
public boolean isUsed() throws BaseException
Check if aMeasuredBioMaterial
is linked to this bio-well- Overrides:
isUsed
in classBasicItem
- Returns:
- TRUE if this biowell has a biomaterial connected., FALSE otherwise.
- Throws:
BaseException
- If not able to tell if item is used or not.- See Also:
BasicItem.getUsingItems()
-
getSharedParent
SharedData getSharedParent()
Description copied from class:ChildItem
Get the shareable parent item of this child item. This is used by theChildItem.initPermissions(int, int)
method to calculate the logged in user's permissions for the child item.- Specified by:
getSharedParent
in classChildItem
- Returns:
- The parent item
-
getPlate
public BioPlate getPlate() throws PermissionDeniedException, BaseException
Get theBioPlate
this biowell belongs to.- Returns:
- The
BioPlate
item - Throws:
PermissionDeniedException
- If the logged in user doesn't havePermission.READ
permission for the bioplateBaseException
- If there is another error
-
getBioMaterial
public MeasuredBioMaterial getBioMaterial() throws PermissionDeniedException, BaseException
Gets theMeasuredBioMaterial
connected to this biowell.- Returns:
- a
MeasuredBioMaterial
item or null. - Throws:
PermissionDeniedException
- If the logged in user doesn't havePermission.READ
permission for the biomaterial.BaseException
- If there is another error
-
getBioMaterialType
public Item getBioMaterialType()
Get the type of biomaterial that is placed in this well.- Returns:
- The biomaterial type (SAMPLE or EXTRACT) or null if there is no biomaterial
- Since:
- 3.2
-
getRow
public int getRow()
Gets the row index where this well is located.- Returns:
- Row number as an
int
-
getColumn
public int getColumn()
Gets the column index where this well is located.- Returns:
- Column number as an
int
-
getPlateCoordinate
public PlateCoordinate getPlateCoordinate()
Get the plate coordinate representation of the coordinate for this well.- Returns:
- A PlateCoordinate object
- Since:
- 2.17
-
getCoordinate
public String getCoordinate()
Get a string representation of the coordinate for this well. Rows are mapped to letters (0-A, 1-B, etc.). Columns are mapped to 1-based numbers (0-1, 1-2, etc.)- Since:
- 2.16
-
isEmpty
public boolean isEmpty()
Is this well empty?- Since:
- 2.16
-
getLockMode
public BioWell.LockMode getLockMode()
Get the lock mode of this well. The lock mode determines if it is possible to add biomaterial to an empty well or remove biomaterial from the well.- Returns:
- The lock mode as determined by the plate's plate type
- Since:
- 2.16
-
canAddBioMaterial
public boolean canAddBioMaterial()
Check if it is possible to add/change biomaterial in this well.- Returns:
- TRUE if it is possible to add biomaterial to the well, FALSE otherwise
- Since:
- 2.16
- See Also:
BioWell.LockMode.canAdd(BioWell)
-
canClearBioMaterial
public boolean canClearBioMaterial()
Check if it is possible to clear the current biomaterial in this well.- Returns:
- TRUE if it is possible to clear the well
- Since:
- 2.16
- See Also:
BioWell.LockMode.canClear(BioWell)
-
hasBeenUsed
public boolean hasBeenUsed()
If the original biomaterial in this well has been moved to another plate (eg. for final storage in a freezer). This property is only defined for well with lock mode=BioWell.LockMode.LOCKED_AFTER_MOVE
.- Returns:
- TRUE if the original biomaterial has been moved
- Since:
- 2.16
-
getOriginalBioMaterial
public MeasuredBioMaterial getOriginalBioMaterial()
Get the original biomaterial that was placed in this biowell. This property is only defined for well with lock mode=BioWell.LockMode.LOCKED_AFTER_MOVE
after the biomaterial has been moved.- Returns:
- The original biomaterial
- Since:
- 2.16
-
-