public class ArraySlide extends AnnotatedItem implements Registered
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
Constructor and Description |
---|
ArraySlide(ArraySlideData data) |
Modifier and Type | Method and Description |
---|---|
static boolean |
barcodeExists(DbControl dc,
String barcode)
Checks if a slide with the given barcode already exists in the database.
|
Set<Annotatable> |
getAnnotatableParents()
Get the array batch.
|
ArrayBatch |
getArrayBatch()
Get the
ArrayBatch item to which this slide belongs. |
String |
getBarcode()
Get the barcode of the slide.
|
int |
getBatchIndex()
Get the index of this slide in the batch.
|
static ArraySlide |
getById(DbControl dc,
int id)
Get a
ArraySlide object when you know the ID. |
(package private) ArraySlideData |
getData()
Get the
BasicData object that holds all data for this item. |
Date |
getEntryDate()
Get the date that the item was registered in the database.
|
static ArraySlide |
getNew(DbControl dc,
ArrayBatch arrayBatch)
Create a new
ArraySlide item. |
PhysicalBioAssay |
getPhysicalBioAssay()
Get the
PhysicalBioAssay item which was used on this slide. |
static ItemQuery<ArraySlide> |
getQuery()
Get a
ItemQuery object configured
to retrieve array slides. |
Item |
getType()
Get the type of item represented by the object.
|
Set<ItemProxy> |
getUsingItems()
Get the bioassay that was used on this plate.
|
boolean |
isDestroyed()
Check if the slide is flagged as destroyed or not.
|
boolean |
isUsed()
Check if this item is used by some other item.
|
boolean |
isUsedByOther(PhysicalBioAssay pba)
Checks if this array slide is used by a different bioassay
than the given one.
|
private void |
setArrayBatch(ArrayBatch arrayBatch)
Set the
ArrayBatch this arrayslide belongs to. |
void |
setBarcode(String barcode)
Set the barcode for the slide.
|
void |
setBatchIndex(int batchIndex)
Set the index of this slide in the batch.
|
void |
setDestroyed(boolean destroyed)
Set if the slide should be flagged as destroyed.
|
getAnnotationSet, getProtocol, isAnnotated, removeAnnotations
getDescription, getName, getRemovedBy, isRemoved, setDescription, setName, setRemoved
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey
getOwner, isOwner, setOwner, takeOwnership
addAnnotatableParents, addUsingItems, addUsingItems, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
getOwner, isOwner, setOwner, takeOwnership
public static final Item TYPE
Item.ARRAYSLIDE
,
getType()
public static final int MAX_BARCODE_LENGTH
setBarcode
method to avoid exceptions.ArraySlide(ArraySlideData data)
public static ArraySlide getNew(DbControl dc, ArrayBatch arrayBatch) throws PermissionDeniedException, BaseException
ArraySlide
item.dc
- The DbControl
which will be used for
permission checking and database accessarrayBatch
- The ArrayBatch
this slide belongs toArraySlide
itemPermissionDeniedException
- If the logged in user doesn't
have use permission for the array batchBaseException
- If there is another errorpublic static ArraySlide getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
ArraySlide
object 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 loadArraySlide
itemItemNotFoundException
- If an item with the specified ID is
not foundPermissionDeniedException
- If the logged in user doesn't
have read permission to the itemBaseException
- If there is another errorpublic static boolean barcodeExists(DbControl dc, String barcode)
dc
- The DbControl to use for database accessbarcode
- The barcode to checkpublic static ItemQuery<ArraySlide> getQuery()
ItemQuery
object configured
to retrieve array slides.ItemQuery
objectArraySlideData getData()
BasicItem
BasicData
object that holds all data for this item.getData
in class AnnotatedItem
public Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
public Set<Annotatable> getAnnotatableParents() throws BaseException
getAnnotatableParents
in interface Annotatable
BaseException
- If there is an errorpublic Date getEntryDate()
Registered
getEntryDate
in interface Registered
public boolean isUsed() throws BaseException
BasicItem
super.isUsed()
, unless it has decided
that the item is used by some other means.isUsed
in class BasicItem
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems() throws BaseException
getUsingItems
in class BasicItem
BaseException
- If there is an error loading the itemsBasicItem.addUsingItems(Set, Item, org.hibernate.Query)
public int getBatchIndex()
public void setBatchIndex(int batchIndex) throws PermissionDeniedException
batchIndex
- The index of the slide in the batchPermissionDeniedException
- This exception is thrown if the
logged in user doesn't have write
permission.public String getBarcode()
public void setBarcode(String barcode) throws PermissionDeniedException, InvalidDataException
MAX_BARCODE_LENGTH
constant.barcode
- The new barcode for the slidePermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- This exception is thrown if the barcode
is longer than MAX_BARCODE_LENGTH
public boolean isDestroyed()
public void setDestroyed(boolean destroyed) throws PermissionDeniedException
destroyed
- true if the slide should be flagged as destroyed,
false otherwisePermissionDeniedException
- If the logged in user doesn't
have write permissionpublic ArrayBatch getArrayBatch() throws PermissionDeniedException, BaseException
ArrayBatch
item to which this slide belongs.ArrayBatch
itemPermissionDeniedException
- If the logged in user doesn't have read
permission for the array batchBaseException
- If there is another errorprivate void setArrayBatch(ArrayBatch arrayBatch) throws InvalidDataException, PermissionDeniedException
ArrayBatch
this arrayslide belongs to.arrayBatch
- the arrayBatch to be set. Cannot be null.InvalidDataException
- If the arrayBatch is nullPermissionDeniedException
- If the logged in user doesn't have
use permission for the batchpublic PhysicalBioAssay getPhysicalBioAssay() throws PermissionDeniedException, BaseException
PhysicalBioAssay
item which was used on this slide. To set,
use the PhysicalBioAssay.setArraySlide(ArraySlide)
method.PhysicalBioAssay
item, or nullPermissionDeniedException
- This exception is thrown if
the logged in user doesn't have read permission to the itemBaseException
- If there is another errorpublic boolean isUsedByOther(PhysicalBioAssay pba)
pba
- The bioassay to check, or null to check if the slide is used
by any bioassay