Class AssayPropertyField

java.lang.Object
net.sf.basedb.util.export.spotdata.AssayPropertyField
All Implemented Interfaces:
AssayField, ExportableField

public class AssayPropertyField
extends Object
implements AssayField
Assay field implementation that exports a named property from a bioassay. The default setting will export the "name" property. One instance of this class is considered to be equal to another if they are configured with the same property and title.
Since:
2.15
Author:
Nicklas
Last modified
$Date: 2015-04-20 11:08:18 +0200 (må, 20 apr 2015) $
  • Field Details

  • Constructor Details

  • Method Details

    • getTitle

      public String getTitle()
      Description copied from interface: ExportableField
      Get the column header.
      Specified by:
      getTitle in interface ExportableField
    • getAssayValue

      public Collection<?> getAssayValue​(DbControl dc, BioAssay ba)
      Return all values that are given by the specified property.
      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()
      Description copied from interface: ExportableField
      Get the data type of the field.
      Specified by:
      getType in interface ExportableField
      Returns:
      A type object or null if not known
    • 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 FALSE
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setProperty

      public void setProperty​(String property)
      Set the property that should be exported. For syntax see Metadata.getPropertyPath(String, boolean). Do not forget to also change the title.
    • getProperty

      public String getProperty()
      Get the configured property.
    • setTitle

      public void setTitle​(String title)
      Set the title of the exported property.
    • setType

      public void setType​(Type type)
      Set the data type of the exported property.
      Since:
      2.15
    • setFormatter

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