2.17.2: 2011-06-17

net.sf.basedb.core
Class BioWell

java.lang.Object
  extended by net.sf.basedb.core.BasicItem<D>
      extended by net.sf.basedb.core.ChildItem<BioWellData>
          extended by net.sf.basedb.core.BioWell
All Implemented Interfaces:
AccessControlled, Identifiable

public class BioWell
extends ChildItem<BioWellData>

A biowell is located on a BioPlate and contains a MeasuredBioMaterial. 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
static class BioWell.LockMode
          The lock mode for a well is determined by the plate's bio plate type.
 
Field Summary
static Item TYPE
          The type of item represented by this class.
 
Constructor Summary
BioWell(BioWellData data)
           
 
Method Summary
 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 the MeasuredBioMaterial connected to this biowell.
static BioWell getById(DbControl dc, int id)
          Get a BioWell 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.
 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 the BioPlate 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 the MeasuredBioMaterial,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 a MeasuredBioMaterial is linked to this bio-well
 
Methods inherited from class net.sf.basedb.core.ChildItem
getPermissionForWriteDeleteAndCreate, getPluginPermissions, initPermissions
 
Methods inherited from class net.sf.basedb.core.BasicItem
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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 a BioWell 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 BioWell item
Throws:
ItemNotFoundException - If an item with the specified id is not found
PermissionDeniedException - If the logged in user doesn't have Permission.READ permission to the item
BaseException - 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()

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

getUsingItems

public Set<ItemProxy> getUsingItems()
Adds the MeasuredBioMaterial,used in this well, to the Set.

Overrides:
getUsingItems in class BasicItem<BioWellData>
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)

isUsed

public boolean isUsed()
               throws BaseException
Check if a MeasuredBioMaterial is linked to this bio-well

Overrides:
isUsed in class BasicItem<BioWellData>
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 the ChildItem.initPermissions(int, int) method to calculate the logged in user's permissions for the child item.

Specified by:
getSharedParent in class ChildItem<BioWellData>
Returns:
The parent item

getPlate

public BioPlate getPlate()
                  throws PermissionDeniedException,
                         BaseException
Get the BioPlate this biowell belongs to.

Returns:
The BioPlate item
Throws:
PermissionDeniedException - If the logged in user doesn't have Permission.READ permission for the bioplate
BaseException - If there is another error

getBioMaterial

public MeasuredBioMaterial getBioMaterial()
                                   throws PermissionDeniedException,
                                          BaseException
Gets the MeasuredBioMaterial connected to this biowell.

Returns:
a MeasuredBioMaterial item or null.
Throws:
PermissionDeniedException - If the logged in user doesn't have Permission.READ permission for the biomaterial.
BaseException - If there is another error

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

2.17.2: 2011-06-17