2.14.1: 2009-11-05

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

java.lang.Object
  extended by net.sf.basedb.util.export.spotdata.SimpleDynamicField
All Implemented Interfaces:
DynamicField, ExportableField

public class SimpleDynamicField
extends Object
implements DynamicField

Represents an exported data field. The object consists of a predefined query expression that can be used in the export query to select the data that is going to be exported, and a title that is exported as part of the table header.

Version:
2.12
Author:
Nicklas
Last modified
$Date: 2009-05-08 13:30:36 +0200 (Fri, 08 May 2009) $

Field Summary
private  Formula.AverageMethod averageMethod
           
private  Expression expression
           
private  Formatter<?> formatter
           
private  String title
           
 
Constructor Summary
SimpleDynamicField()
          Create a new object.
 
Method Summary
 Formula.AverageMethod getAverageMethod()
          Get the average method to use if the exporter is exporting averaged data.
 Expression getExpression()
          Get the configured express.
 Expression getExpression(DbControl dc, BioAssaySet source, boolean forAverage)
          Returns the configured expression.
 Formatter<?> getFormatter()
          Get a formatter that converts the values in this field to strings.
 String getTitle()
          Get the column header.
 void setAverageMethod(Formula.AverageMethod averageMethod)
          Set the average method to use when exporting averaged data.
 void setExpression(Expression expression)
          Set the expression used to select data in the query.
 void setFormatter(Formatter<?> formatter)
          Set a formatter to use for formatting the exported values.
 void setTitle(String title)
          Set the column header title.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expression

private Expression expression

averageMethod

private Formula.AverageMethod averageMethod

formatter

private Formatter<?> formatter

title

private String title
Constructor Detail

SimpleDynamicField

public SimpleDynamicField()
Create a new object. Before it can be used it must be configured.

Method Detail

getTitle

public String getTitle()
Description copied from interface: ExportableField
Get the column header.

Specified by:
getTitle in interface ExportableField

getExpression

public Expression getExpression(DbControl dc,
                                BioAssaySet source,
                                boolean forAverage)
Returns the configured expression. If 'forAverage' is TRUE the confgured Formula.AverageMethod is allowed to transform the expression. If no average method has been configured the average method specified by the IntensityTransform from the 'source' bioassay set is used.

Specified by:
getExpression in interface DynamicField
Parameters:
dc - The DbControl that is used for database access
source - The source bioassay set
forAverage - TRUE if the expression should generate an average of multiple values
Returns:
An expression, or null if it is not possible to create an expression in the given case (this will normally be replaced with an empty column in the output)

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).

getExpression

public Expression getExpression()
Get the configured express.


setExpression

public void setExpression(Expression expression)
Set the expression used to select data in the query.


setTitle

public void setTitle(String title)
Set the column header title.


getAverageMethod

public Formula.AverageMethod getAverageMethod()
Get the average method to use if the exporter is exporting averaged data. If no average method has been configured, the everage method specified by the IntensityTransform of the source bioassay set is used.


setAverageMethod

public void setAverageMethod(Formula.AverageMethod averageMethod)
Set the average method to use when exporting averaged data.


setFormatter

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


2.14.1: 2009-11-05