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) $
-
-
Constructor Summary
Constructors Constructor Description AssayPropertyField()
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 property and has the same title.Collection<?>
getAssayValue(DbControl dc, BioAssay ba)
Return all values that are given by the specified property.Formatter<?>
getFormatter()
Get a formatter that converts the values in this field to strings.String
getProperty()
Get the configured property.String
getTitle()
Get the column header.Type
getType()
Get the data type of the field.int
hashCode()
boolean
isAnnotation()
A boolean flag indicating if the field is an annotation or not.void
setFormatter(Formatter<?> formatter)
Set a formatter to use for formatting the exported values.void
setProperty(String property)
Set the property that should be exported.void
setTitle(String title)
Set the title of the exported property.void
setType(Type type)
Set the data type of the exported property.String
toString()
-
-
-
Constructor Detail
-
AssayPropertyField
public AssayPropertyField()
Create a new annotation field. The property is automatically set to "name". CallsetProperty(String)
andsetTitle(String)
to change.
-
-
Method Detail
-
getTitle
public String getTitle()
Description copied from interface:ExportableField
Get the column header.- Specified by:
getTitle
in interfaceExportableField
-
getAssayValue
public Collection<?> getAssayValue(DbControl dc, BioAssay ba)
Return all values that are given by the specified property.- 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()
Description copied from interface:ExportableField
Get the data type of the field.- Specified by:
getType
in interfaceExportableField
- 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 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 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.
-
setProperty
public void setProperty(String property)
Set the property that should be exported. For syntax seeMetadata.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.
-
-