2.17.2: 2011-06-17

net.sf.basedb.util.export.spotdata
Class AnnotationAssayField

java.lang.Object
  extended by 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 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 (Tue, 03 Aug 2010) $

Field Summary
private  AnnotationType at
           
private  Formatter<?> formatter
           
private  SnapshotManager snapshotManager
           
private  String title
           
 
Constructor Summary
AnnotationAssayField()
          Create a new annotation field.
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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. Call setAnnotationType(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 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

toString

public String toString()
Overrides:
toString 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

2.17.2: 2011-06-17