Class Plate

  • All Implemented Interfaces:
    AccessControlled, Annotatable, Identifiable, Nameable, Ownable, Registered, Removable, Shareable

    public class Plate
    extends AnnotatedItem
    implements Registered
    This class is represents physical plates. A plate must have a 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.

    Version:
    2.0
    Author:
    Nicklas
    Last modified
    $Date: 2017-05-22 14:35:27 +0200 (må, 22 maj 2017) $
    • Field Detail

      • 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

    • Method Detail

      • getNew

        public static Plate getNew​(DbControl dc,
                                   PlateType plateType)
                            throws BaseException
        Create a new Plate item.
        Parameters:
        dc - The DbControl which will be used for permission checking and database access
        plateType - The type of the new plate
        Returns:
        The new Plate item
        Throws:
        PermissionDeniedException - If the loggged in user doesn't have use permission for the plate type
        InvalidDataException - If the plate type is null
        BaseException - If there is another error
      • getQuery

        public static ItemQuery<Plate> getQuery()
        Get a query that returns plates.
        Returns:
        An ItemQuery object
      • 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.
        Specified by:
        getType in interface Identifiable
        Returns:
        A value indicating the type of item
      • getEntryDate

        public Date getEntryDate()
        Description copied from interface: Registered
        Get the date that the item was registered in the database.
        Specified by:
        getEntryDate in interface Registered
        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 interface Registered
        Parameters:
        entryDate - A date or null to use today's date
      • getDestinationIndex

        public int getDestinationIndex()
        If the plate was created by a plate mapping, this is the index of this plate in the list of created plates. First plate have index 0.
      • getBarcode

        public String getBarcode()
        Get the barcode of this plate. The barcode is not used by the core and it is not required that it is unique.
      • isDestroyed

        public boolean isDestroyed()
        Check if the plate has been destroyed. A destroyed plate can't be used by a PlateMapping to create new plates or to create ArrayDesign:s.
      • setDestroyed

        public void setDestroyed​(boolean destroyed)
                          throws PermissionDeniedException
        Set the destroyed flag. A destroyed plate can't be used by a PlateMapping to create new plates or to create ArrayDesign:s.
        Parameters:
        destroyed - TRUE if the plate is destroyed, FALSE otherwise.
        Throws:
        PermissionDeniedException - If the logged in user doesn't have write permission on the item.
      • getParentPlates

        public ItemQuery<Plate> getParentPlates()
        Get a query returning the parent plates of this plate. A plate has parents if it was created by a PlateMapping.
        Returns:
        An ItemQuery object
      • getSourceIndex

        public int getSourceIndex​(Plate parent)
                           throws InvalidDataException
        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. If the plate is not a parent, -1 is returned.
        Parameters:
        parent - The plate to get source index of, if it's a parent. Null is not allowed.
        Returns:
        The source index or -1 if the plate is not a parent plate
        Throws:
        InvalidDataException - If the parent is null
      • getChildPlates

        public ItemQuery<Plate> getChildPlates()
        Get a query returning the child plates of this plate.
        Returns:
        An ItemQuery object
      • hasEvent

        public boolean hasEvent​(PlateEventType eventType)
        Check if an event for the specified event type has been created for this plate. A plate may only have one event of each type.
        Parameters:
        eventType - The event type to check
        Returns:
        TRUE if an event of the specified type exists, FALSE otherwise
        See Also:
        getEvent(PlateEventType), getEvents()
      • getWell

        public Well getWell​(int row,
                            int column)
                     throws PermissionDeniedException,
                            BaseException
        Get the well on the specified plate coordinate.
        Parameters:
        row - The row coordinate of the well. Starting at 0.
        column - The column coordinate of the well. Starting at 0.
        Returns:
        A Well item or null if the coordinates are outside the range specified by the geometry
        Throws:
        PermissionDeniedException - If the logged in user doesn't have read permission for the well
        BaseException - If there is another error
      • getWells

        public ItemQuery<Well> getWells()
        Get a query returning all wells for this plate.
        Returns:
        An ItemQuery object
        Throws:
        BaseException - If there is an error
      • getReporters

        public DataQuery<ReporterData> getReporters()
        Get a query that returns the reporters on this plate. The query is rooted at the wells, which means that:
        • All filters, sorting, etc. that works for getWells() can be used without modifications on this query.
        • The same reporter may be returned multiple times if it is present on several wells.
        • 'Null' values may be returned if there are wells without a reporter
        Returns:
        A DataQuery object
        Since:
        2.8