2.12.0: 2009-05-27

net.sf.basedb.core
Class BioPlate

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<BioPlateData>
                      extended by net.sf.basedb.core.BioPlate
All Implemented Interfaces:
AccessControlled, Annotatable, Identifiable, Nameable, Ownable, Removable, Shareable

public class BioPlate
extends AnnotatedItem<BioPlateData>

This class is represents physical bio-plates. A bio-plate must have a PlateGeometry

A bio-plate consists of BioWell:s which are organised into rows and columns as specified by the plate geometry.

Version:
2.10
Author:
martin
Last modified
$Date: 2008-12-11 16:27:45 +0100 (Thu, 11 Dec 2008) $

Field Summary
static int MAX_BARCODE_LENGTH
          The maximum length of the barcode that can be stored in the database.
static Item TYPE
          The type of item represented by this class.
 
Fields inherited from interface net.sf.basedb.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
 
Constructor Summary
BioPlate(BioPlateData annotatedData)
           
 
Method Summary
 Set<Annotatable> getAnnotatableParents()
          Gets parent plates, always returns null
 String getBarcode()
          Gets the barcode of this bio plate.
 BioWell getBioWell(int row, int column)
          Gets bio well for specific location.
 ItemQuery<BioWell> getBioWells()
          Gets a query that returns all BioWells on this plate.
static BioPlate getById(DbControl dc, int id)
          Gets a BioPlate when knowing the item's id
 String getExternalId()
          Gets the external id of this bio plate
 Hardware getFreezer()
          Gets the freezer associated with this bio plate
static BioPlate getNew(DbControl dc, PlateGeometry plateGeometry)
          Creates a new bioplate with a specific plate geometry
 PlateGeometry getPlateGeometry()
          Get the PlateGeometry of this bioplate.
static ItemQuery<BioPlate> getQuery()
          Gets query that selects all available bioplates
 Item getType()
          Get the type of item represented by the object.
 Set<ItemProxy> getUsingItems()
          Gets all MeasuredBioMaterial located on this plate
 boolean isUsed()
          Check if there are any MeasuredBioMaterial on this plate
 void setBarcode(String barcode)
          Sets the bio plates barcode
 void setExternalId(String externalId)
          Sets the external id of this bio plate
 void setFreezer(Hardware freezer)
          Sets the freezer where this bio plate is stored
private  void setPlateGeometry(PlateGeometry plateGeometry)
           
 
Methods inherited from class net.sf.basedb.core.AnnotatedItem
getAnnotationSet, getProtocol, 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, onBeforeCommit, 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.BIOPLATE, getType()

MAX_BARCODE_LENGTH

public static final int MAX_BARCODE_LENGTH
The maximum length of the barcode that can be stored in the database. Check the length against this value before calling the setBarcode(String) method to avoid exceptions.

See Also:
Constant Field Values
Constructor Detail

BioPlate

BioPlate(BioPlateData annotatedData)
Method Detail

getNew

public static BioPlate getNew(DbControl dc,
                              PlateGeometry plateGeometry)
                       throws BaseException,
                              InvalidDataException
Creates a new bioplate with a specific plate geometry

Parameters:
dc - DbControl used for database access
plateGeometry - The geometry the new plate should have
Returns:
A new BioPlate object
Throws:
BaseException - If anything goes wrong when creating.
InvalidDataException - If plateGemoetry is null

getById

public static BioPlate getById(DbControl dc,
                               int id)
                        throws ItemNotFoundException,
                               PermissionDeniedException,
                               BaseException
Gets a BioPlate when knowing the item's id

Parameters:
dc - DbControl used for database access
id - The item's id.
Returns:
BioPlate object
Throws:
ItemNotFoundException - If no item with the given id was found
PermissionDeniedException - If logged in user doesn't have enough permission to the requested item
BaseException - If there is another error.

getQuery

public static ItemQuery<BioPlate> getQuery()
Gets query that selects all available bioplates

Returns:
ItemQuery object

getAnnotatableParents

public Set<Annotatable> getAnnotatableParents()
                                       throws BaseException
Gets parent plates, always returns null

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

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

isUsed

public boolean isUsed()
Check if there are any MeasuredBioMaterial on this plate

Overrides:
isUsed in class BasicItem<BioPlateData>
Returns:
TRUE if this item is used, FALSE otherwise
See Also:
BasicItem.getUsingItems()

getUsingItems

public Set<ItemProxy> getUsingItems()
Gets all MeasuredBioMaterial located on this plate

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

getPlateGeometry

public PlateGeometry getPlateGeometry()
                               throws PermissionDeniedException,
                                      BaseException
Get the PlateGeometry of this bioplate.

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

setPlateGeometry

private void setPlateGeometry(PlateGeometry plateGeometry)
                       throws PermissionDeniedException,
                              InvalidDataException
Throws:
PermissionDeniedException
InvalidDataException

setExternalId

public void setExternalId(String externalId)
                   throws PermissionDeniedException,
                          InvalidDataException
Sets the external id of this bio plate

Parameters:
externalId - The external id to set. Null is allowed. Maximum length BioPlateData.MAX_EXTERNAL_ID_LENGTH characters.
Throws:
PermissionDeniedException - If logged in user doesn't have Permission.WRITE on the plate
InvalidDataException - If maximum length of externalId is exceeded.

getExternalId

public String getExternalId()
Gets the external id of this bio plate

Returns:
A String object or null

setBarcode

public void setBarcode(String barcode)
                throws PermissionDeniedException,
                       InvalidDataException
Sets the bio plates barcode

Parameters:
barcode - The barcode to set. Null is allowed. Maximum length BioPlateData.MAX_BARCODE_LENGTH characters.
Throws:
PermissionDeniedException - If logged in user doesn't have Permission.WRITE on the plate.
InvalidDataException - If maximum length of barcode is exceeded.

getBarcode

public String getBarcode()
Gets the barcode of this bio plate.

Returns:
A String object or null.

setFreezer

public void setFreezer(Hardware freezer)
                throws PermissionDeniedException
Sets the freezer where this bio plate is stored

Parameters:
freezer - The freezer to set. Null is allowed.
Throws:
PermissionDeniedException - If logged in user doesn't have Permission.WRITE on this bio plate or Permission.USE on the freezer.

getFreezer

public Hardware getFreezer()
Gets the freezer associated with this bio plate

Returns:
A Hardware item or null.

getBioWells

public ItemQuery<BioWell> getBioWells()
Gets a query that returns all BioWells on this plate.

Returns:
an ItemQuery object.

getBioWell

public BioWell getBioWell(int row,
                          int column)
Gets bio well for specific location.

Parameters:
row - Row index where the bio well is located.
column - Column index where the bio well is located
Returns:
A BioWell object or null if no bio well can be found

2.12.0: 2009-05-27