Package net.sf.basedb.core
Class PlateGeometry
- java.lang.Object
-
- net.sf.basedb.core.BasicItem
-
- net.sf.basedb.core.PlateGeometry
-
- All Implemented Interfaces:
AccessControlled
,Identifiable
,Nameable
,Registered
,Removable
public class PlateGeometry extends BasicItem implements Nameable, Removable, Registered
This class defines a plate geometry, which is the number of rows and columns of wells on aPlate
. The number of rows and columns must be specified when the item is created, and the values can't be changed after that.A
PlateMapping
is a way to specify how one geometry can be transformed to another. It holds information for how to map all source wells to destination wells. For example it can map four 96-well plates to one 384-well plate.- Version:
- 2.0
- Author:
- Nicklas
- See Also:
Plate
,PlateMapping
- Last modified
- $Date: 2017-05-22 14:35:27 +0200 (må, 22 maj 2017) $
-
-
Field Summary
Fields Modifier and Type Field Description 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
Constructors Constructor Description PlateGeometry(PlateGeometryData plateGeometryData)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PlateGeometry
getById(DbControl dc, int id)
Get aPlateGeometry
item when you know the id.int
getColumns()
Get the number of columns in this geometry.(package private) PlateGeometryData
getData()
Get theBasicData
object that holds all data for this item.String
getDescription()
Get the description for the item.Date
getEntryDate()
Get the date that the item was registered in the database.String
getName()
Get the name of the item.static PlateGeometry
getNew(DbControl dc, int rows, int columns)
Create a newPlateGeometry
item.ItemQuery<PlateType>
getPlateTypes()
Get a query returning all plate types using this geometry.static ItemQuery<PlateGeometry>
getQuery()
Get a query configured to retrieve plate geometries.User
getRemovedBy()
Get the user that flagged this item for removal.int
getRows()
Get the number of rows in this geometry.Item
getType()
Get the type of item represented by the object.Set<ItemProxy>
getUsingItems()
Get all:PlateType
:s of this geometryPlateMapping
:s using this geometryBioPlate
:s using this geometryboolean
isRemoved()
Check if the removed flag is set for this item.boolean
isUsed()
Check if: APlateType
with this geometry exists APlateMapping
to/from this geometry exists ABioPlate
that uses this geometry existsPlateType
newPlateType()
Create a newPlateType
of this geometry.private void
setColumns(int columns)
The number of columns cannot be changed, used at object creation only.void
setDescription(String description)
Set the description for the item.void
setEntryDate(Date entryDate)
Set the date the entry was registered in the database.void
setName(String name)
Set the name of the item.void
setRemoved(boolean removed)
Set the removed flag for this item.private void
setRows(int rows)
The number of rows cannot be changed, used at object creation only.-
Methods inherited from class net.sf.basedb.core.BasicItem
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, initPermissions, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
-
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getVersion
-
-
-
-
Field Detail
-
TYPE
public static final Item TYPE
The type of item represented by this class.- See Also:
Item.PLATEGEOMETRY
,getType()
-
-
Constructor Detail
-
PlateGeometry
PlateGeometry(PlateGeometryData plateGeometryData)
-
-
Method Detail
-
getNew
public static PlateGeometry getNew(DbControl dc, int rows, int columns) throws InvalidDataException, BaseException
Create a newPlateGeometry
item.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database accessrows
- The number of rowscolumns
- The number of columns- Returns:
- The new
PlateGeometry
item - Throws:
InvalidDataException
- If the number of rows or columns is less than or equal to zeroBaseException
- If there is an error
-
getById
public static PlateGeometry getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Get aPlateGeometry
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
PlateGeometry
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<PlateGeometry> getQuery()
Get a query configured to retrieve plate geometries.- Returns:
- An
ItemQuery
object
-
getData
PlateGeometryData 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.- Specified by:
getType
in interfaceIdentifiable
- Returns:
- A value indicating the type of item
-
getName
public String getName()
Description copied from interface:Nameable
Get the name of the item.
-
setName
public void setName(String name) throws PermissionDeniedException, InvalidDataException
Description copied from interface:Nameable
Set the name of the item. The name cannot be null and mustn't be longer than the value specified by theNameable.MAX_NAME_LENGTH
constant.- Specified by:
setName
in interfaceNameable
- Parameters:
name
- The new name for the item- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionInvalidDataException
- If the name is null or longer than specified by theNameable.MAX_NAME_LENGTH
constant
-
getDescription
public String getDescription()
Description copied from interface:Nameable
Get the description for the item.- Specified by:
getDescription
in interfaceNameable
- Returns:
- A
String
with a description of the item
-
setDescription
public void setDescription(String description) throws PermissionDeniedException, InvalidDataException
Description copied from interface:Nameable
Set the description for the item. The description can be null but mustn't be longer than the value specified by theNameable.MAX_DESCRIPTION_LENGTH
constant.- Specified by:
setDescription
in interfaceNameable
- Parameters:
description
- The new description for the item- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionInvalidDataException
- If the description longer than specified by theNameable.MAX_DESCRIPTION_LENGTH
constant
-
isRemoved
public boolean isRemoved()
Description copied from interface:Removable
Check if the removed flag is set for this item.
-
setRemoved
public void setRemoved(boolean removed) throws PermissionDeniedException
Description copied from interface:Removable
Set the removed flag for this item.- Specified by:
setRemoved
in interfaceRemovable
- Parameters:
removed
- TRUE if the item should be flagged as removed, FALSE otherwise- Throws:
PermissionDeniedException
- If the logged in user doesn't havePermission.DELETE
permission for setting the flag to TRUE orPermission.WRITE
permission for setting the flag to FALSE
-
getRemovedBy
public User getRemovedBy() throws PermissionDeniedException, ItemNotFoundException
Description copied from interface:Removable
Get the user that flagged this item for removal.- Specified by:
getRemovedBy
in interfaceRemovable
- Returns:
- A User object, or null if this item has not been flagged
- Throws:
PermissionDeniedException
- If the logged in user doesn't havePermission.READ
permission for the userItemNotFoundException
- If the user that removed this item can't be found
-
getEntryDate
public Date getEntryDate()
Description copied from interface:Registered
Get the date that the item was registered in the database.- Specified by:
getEntryDate
in interfaceRegistered
- Returns:
- A date or null if this is not known
-
setEntryDate
public void setEntryDate(Date entryDate)
Description copied from interface:Registered
Set the date the entry was registered in the database. Implementations should only allow this property to be set before the item is first stored in the database. The intention of this method is to facilitate export/import of data between server.- Specified by:
setEntryDate
in interfaceRegistered
- Parameters:
entryDate
- A date or null to use today's date
-
isUsed
public boolean isUsed() throws BaseException
Check if:- A
PlateType
with this geometry exists - A
PlateMapping
to/from this geometry exists - A
BioPlate
that uses this geometry exists
- Overrides:
isUsed
in classBasicItem
- Returns:
- TRUE if this item is used, FALSE otherwise
- Throws:
BaseException
- If not able to tell if item is used or not.- See Also:
BasicItem.getUsingItems()
- A
-
getUsingItems
public Set<ItemProxy> getUsingItems()
Get all:PlateType
:s of this geometryPlateMapping
:s using this geometryBioPlate
:s using this geometry
- Overrides:
getUsingItems
in classBasicItem
- Returns:
- A set containing proxies for the items, or an empty set if no items are using this item
- Since:
- 2.2
- See Also:
BasicItem.addUsingItems(Set, Item, org.hibernate.query.Query)
-
getRows
public int getRows()
Get the number of rows in this geometry.- Returns:
- The number of rows
-
setRows
private void setRows(int rows) throws InvalidDataException
The number of rows cannot be changed, used at object creation only.- Throws:
InvalidDataException
- If the row count is less than 1
-
getColumns
public int getColumns()
Get the number of columns in this geometry.- Returns:
- The number of columns
-
setColumns
private void setColumns(int columns) throws InvalidDataException
The number of columns cannot be changed, used at object creation only.- Throws:
InvalidDataException
- If the column count is less than 1
-
newPlateType
public PlateType newPlateType() throws PermissionDeniedException, BaseException
Create a newPlateType
of this geometry.- Returns:
- The new plate type
- Throws:
PermissionDeniedException
- If the logged in user doesn't have use permission for this plate geometryBaseException
- If there is another error
-
-