Class AnnotationAssayField

  • All Implemented Interfaces:
    AssayField, ExportableField

    public class AnnotationAssayField
    extends Object
    implements AssayField
    Assay field implementation that exports the annotations of a bioassay. Before it can be used an AnnotationType must be configured. One instance of this class is considered to be equal to another if they are configured with the same annotation type and title.
    Version:
    2.12
    Author:
    Nicklas
    Last modified
    $Date: 2010-08-03 11:11:54 +0200 (ti, 03 aug 2010) $
    • Method Detail

      • getTitle

        public String getTitle()
        Returns the name of the configured annotation type, or the empty string if not configured.
        Specified by:
        getTitle in interface ExportableField
      • getAssayValue

        public Collection<?> getAssayValue​(DbControl dc,
                                           BioAssay ba)
        Return all annotation values that are related to the specified bioassay, or null if not configured.
        Specified by:
        getAssayValue in interface AssayField
        Parameters:
        dc - The DbControl that is used for database access
        ba - The bioassay to get the value(s) from
        Returns:
        A collection with one or more values, or null or an empty collection if there is no value for the given bioassay
      • getType

        public Type getType()
        Return the value type of the annotation type, or null if not configured.
        Specified by:
        getType in interface ExportableField
        Returns:
        A type object or null if not known
        Since:
        2.15
      • getFormatter

        public Formatter<?> getFormatter()
        Description copied from interface: ExportableField
        Get a formatter that converts the values in this field to strings.
        Specified by:
        getFormatter in interface ExportableField
        Returns:
        A formatter or null to use default formatting (normally this means calling the toString() method).
      • isAnnotation

        public boolean isAnnotation()
        Description copied from interface: AssayField
        A boolean flag indicating if the field is an annotation or not.
        Specified by:
        isAnnotation in interface AssayField
        Returns:
        Always TRUE
      • equals

        public boolean equals​(Object obj)
        An assay field is equal to another assay field if it uses the same annotation type and has the same title.
        Overrides:
        equals in class Object
        Since:
        2.15
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
        Since:
        2.15
      • setAnnotationType

        public void setAnnotationType​(AnnotationType at)
        Set the annotation type of the annotations that should be exported in this field.
      • getAnnotationType

        public AnnotationType getAnnotationType()
        Get the configured annotation type.
      • setFormatter

        public void setFormatter​(Formatter<?> formatter)
        Set a formatter to use for formatting the exported values.
      • setSnapshotManager

        public void setSnapshotManager​(SnapshotManager snapshotManager)
        Set the snapshot manager that should be used to load annotation values.
        Since:
        2.14
      • setTitle

        public void setTitle​(String title)
        Set a custom title for the assay field.
        Parameters:
        title - The custom title or null to use the name of the annotation type