Class AnnotationAssayField
- java.lang.Object
-
- net.sf.basedb.util.export.spotdata.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 anAnnotationType
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) $
-
-
Field Summary
Fields Modifier and Type Field Description private AnnotationType
at
private Formatter<?>
formatter
private SnapshotManager
snapshotManager
private String
title
-
Constructor Summary
Constructors Constructor Description AnnotationAssayField()
Create a new annotation field.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.AnnotationType
getAnnotationType()
Get the configured annotation type.Collection<?>
getAssayValue(DbControl dc, BioAssay ba)
Return all annotation values that are related to the specified bioassay, or null if not configured.Formatter<?>
getFormatter()
Get a formatter that converts the values in this field to strings.String
getTitle()
Returns the name of the configured annotation type, or the empty string if not configured.Type
getType()
Return the value type of the annotation type, or null if not configured.int
hashCode()
boolean
isAnnotation()
A boolean flag indicating if the field is an annotation or not.void
setAnnotationType(AnnotationType at)
Set the annotation type of the annotations that should be exported in this field.void
setFormatter(Formatter<?> formatter)
Set a formatter to use for formatting the exported values.void
setSnapshotManager(SnapshotManager snapshotManager)
Set the snapshot manager that should be used to load annotation values.void
setTitle(String title)
Set a custom title for the assay field.String
toString()
-
-
-
Field Detail
-
at
private AnnotationType at
-
title
private String title
-
formatter
private Formatter<?> formatter
-
snapshotManager
private SnapshotManager snapshotManager
-
-
Constructor Detail
-
AnnotationAssayField
public AnnotationAssayField()
Create a new annotation field. CallsetAnnotationType(AnnotationType)
before use.
-
-
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 interfaceExportableField
-
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 interfaceAssayField
- Parameters:
dc
- The DbControl that is used for database accessba
- 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 interfaceExportableField
- 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 interfaceExportableField
- 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 interfaceAssayField
- 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.
-
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
-
-