public class Plate extends AnnotatedItem<PlateData> implements Registered
PlateType
, which defines the geometry and possible events
for the plate.
A plate consists of Well
:s which are created at the same
time the plate is created. The wells are organised into rows and
columns as specified by the plate geometry.
A plate is either created directly or as the result of a PlateMapping
operation from other plates. In the first case the
wells must be linked to reporters before the plate is saved. In
the latter case the linking is done automatically from the
source plates.
Modifier and Type | Field and Description |
---|---|
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.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Modifier and Type | Method and Description |
---|---|
java.util.Set<Annotatable> |
getAnnotatableParents()
Get the parent plates, if any.
|
java.lang.String |
getBarcode()
Get the barcode of this plate.
|
static Plate |
getById(DbControl dc,
int id)
Get a
Plate item when you know the id. |
ItemQuery<Plate> |
getChildPlates()
Get a query returning the child plates of this plate.
|
int |
getDestinationIndex()
If the plate was created by a plate mapping, this is the index
of this plate in the list of created plates.
|
java.util.Date |
getEntryDate()
Get the date that the item was registered in the database.
|
PlateEvent |
getEvent(PlateEventType eventType)
Get the event for the specified event type.
|
ItemQuery<PlateEvent> |
getEvents()
Get a query that returns all event types for this plate type.
|
static Plate |
getNew(DbControl dc,
PlateType plateType)
Create a new
Plate item. |
ItemQuery<Plate> |
getParentPlates()
Get a query returning the parent plates of this plate.
|
PlateMapping |
getPlateMapping()
Get the
PlateMapping used to create this plate. |
PlateType |
getPlateType()
Get the
PlateType of this plate. |
static ItemQuery<Plate> |
getQuery()
Get a query that returns plates.
|
DataQuery<ReporterData> |
getReporters()
Get a query that returns the reporters on this plate.
|
int |
getSourceIndex(Plate parent)
If this plate was created by a
PlateMapping and the specified plate
is a parent, get the index of the parent plate in the list
of source plates used by the plate mapping. |
Item |
getType()
Get the type of item represented by the object.
|
java.util.Set<ItemProxy> |
getUsingItems()
Get all:
Child plates
ArrayDesign :s using this plate
|
Well |
getWell(int row,
int column)
Get the well on the specified plate coordinate.
|
ItemQuery<Well> |
getWells()
Get a query returning all wells for this plate.
|
boolean |
hasEvent(PlateEventType eventType)
Check if an event for the specified event type has been created
for this plate.
|
boolean |
isDestroyed()
Check if the plate has been destroyed.
|
boolean |
isUsed()
Check if:
another
Plate has been created from this one (via a PlateMapping )
any ArrayDesign :s are using this plate
Wells are deleted automatically. |
void |
setBarcode(java.lang.String barcode)
Set the barcode for the plate.
|
void |
setDestroyed(boolean destroyed)
Set the destroyed flag.
|
private void |
setPlateType(PlateType plateType)
Set the plate type of this plate.
|
getAnnotationSet, getProtocol, isAnnotated, removeAnnotations, toTransferable
getDescription, getName, isRemoved, setDescription, setName, setRemoved, toTransferable
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey, toTransferable
getOwner, isOwner, setOwner, takeOwnership, toTransferable
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
getOwner, isOwner, setOwner, takeOwnership
public static final Item TYPE
Item.PLATE
,
getType()
public static final int MAX_BARCODE_LENGTH
setBarcode(String)
method to avoid exceptions.Plate(PlateData plateData)
public static Plate getNew(DbControl dc, PlateType plateType) throws BaseException
Plate
item.dc
- The DbControl
which will be used for
permission checking and database accessplateType
- The type of the new platePlate
itemPermissionDeniedException
- If the loggged in user
doesn't have use permission for the plate typeInvalidDataException
- If the plate type is nullBaseException
- If there is another errorpublic static Plate getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Plate
item when you know the id.dc
- The DbControl
which will be used for
permission checking and database access.id
- The id of the item to loadPlate
itemItemNotFoundException
- If an item with the specified
id is not foundPermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission to the itemBaseException
- If there is another errorpublic static ItemQuery<Plate> getQuery()
ItemQuery
objectpublic Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
public java.util.Set<Annotatable> getAnnotatableParents() throws BaseException
getAnnotatableParents
in interface Annotatable
BaseException
- If there is an errorpublic java.util.Date getEntryDate()
Registered
getEntryDate
in interface Registered
public boolean isUsed() throws BaseException
Plate
has been created from this one (via a PlateMapping
)
ArrayDesign
:s are using this plate
isUsed
in class BasicItem<PlateData>
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public java.util.Set<ItemProxy> getUsingItems()
ArrayDesign
:s using this plate
getUsingItems
in class BasicItem<PlateData>
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
public PlateType getPlateType() throws PermissionDeniedException, BaseException
PlateType
of this plate.PlateType
itemPermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission for the plate typeBaseException
- If there is another errorprivate void setPlateType(PlateType plateType) throws PermissionDeniedException, InvalidDataException
PermissionDeniedException
- If the logged in user
doesn't have use permission for the plate typeInvalidDataException
- If the plate type is nullpublic PlateMapping getPlateMapping() throws PermissionDeniedException, BaseException
PlateMapping
used to create this plate.PlateMapping
item, or null if this plate was not
created using a mappingPermissionDeniedException
- If the logged in user doesn't have
read permission to the plate mappingBaseException
- If there is another errorpublic int getDestinationIndex()
public java.lang.String getBarcode()
public void setBarcode(java.lang.String barcode) throws PermissionDeniedException, InvalidDataException
MAX_BARCODE_LENGTH
constant. Normally,
this should be a unique value among all plates, but the core does not
check this.barcode
- The new barcode for the platePermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the value is too longpublic boolean isDestroyed()
PlateMapping
to create new plates
or to create ArrayDesign
:s.public void setDestroyed(boolean destroyed) throws PermissionDeniedException
PlateMapping
to create new plates
or to create ArrayDesign
:s.destroyed
- TRUE if the plate is destroyed, FALSE otherwise.PermissionDeniedException
- If the logged in user doesn't
have write permission on the item.public ItemQuery<Plate> getParentPlates()
PlateMapping
.ItemQuery
objectpublic int getSourceIndex(Plate parent) throws InvalidDataException
PlateMapping
and the specified plate
is a parent, get the index of the parent plate in the list
of source plates used by the plate mapping. If the plate is not a parent, -1
is returned.parent
- The plate to get source index of, if it's a parent. Null is not allowed.InvalidDataException
- If the parent is nullpublic ItemQuery<Plate> getChildPlates()
ItemQuery
objectpublic PlateEvent getEvent(PlateEventType eventType) throws PermissionDeniedException, InvalidDataException, BaseException
eventType
- The event type to get or create the event forPlateEvent
itemPermissionDeniedException
- If the logged in user
doesn't have read permission for an existing event
or doesn't have write permission if a new event must be
createdInvalidDataException
- If the event type is null or
doesn't belong to the same PlateType
as the plateBaseException
- If there is another errorhasEvent(PlateEventType)
,
getEvents()
public boolean hasEvent(PlateEventType eventType)
eventType
- The event type to checkgetEvent(PlateEventType)
,
getEvents()
public ItemQuery<PlateEvent> getEvents()
ItemQuery
objectBaseException
- If there is an errorpublic Well getWell(int row, int column) throws PermissionDeniedException, BaseException
row
- The row coordinate of the well. Starting at 0.column
- The column coordinate of the well. Starting at 0.Well
item or null if the coordinates
are outside the range specified by the geometryPermissionDeniedException
- If the logged in user doesn't
have read permission for the wellBaseException
- If there is another errorpublic ItemQuery<Well> getWells()
ItemQuery
objectBaseException
- If there is an errorpublic DataQuery<ReporterData> getReporters()
getWells()
can be
used without modifications on this query.
DataQuery
object