Package adams.data.sampledata
Class SampleData
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.data.report.Report
-
- adams.data.sampledata.SampleData
-
- All Implemented Interfaces:
adams.core.CloneHandler<adams.data.report.Report>
,adams.core.logging.LoggingSupporter
,adams.core.Mergeable<adams.data.report.Report>
,adams.core.SizeOfHandler
,adams.data.id.DatabaseIDHandler
,adams.data.id.IDHandler
,adams.data.id.MutableDatabaseIDHandler
,adams.data.id.MutableIDHandler
,adams.data.spreadsheet.SpreadSheetSupporter
,Serializable
,Comparable
public class SampleData extends adams.data.report.Report implements adams.data.id.MutableIDHandler
Read and store data from the Sample Report.- Version:
- $Revision: 11831 $
- Author:
- dale
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_FORMAT
the default data type.static String
DEFAULT_INSTRUMENT
the default instrument ('unknown').static String
FORMAT
field name for the format.static String
INSERT_TIMESTAMP
field name for time of insertion into database.static String
INSTRUMENT
field name for the instrument.static String
SAMPLE_ID
field name for the sample ID.static String
SAMPLE_TYPE
field name for the sample type.static String
SOURCE
field name for the source.
-
Constructor Summary
Constructors Constructor Description SampleData()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SampleData
createDummy(String instrument, Date insertDate, String format)
Creates a dummy report.String
getID()
Returns the ID.protected void
initFields()
Set field types.static SampleData
parseProperties(adams.core.Properties props)
Parses the properties (generated with the toProperties() method) and generates a sample data object from it.static SampleData
parseReport(String s)
Parses the string generated by the toString() method.void
setID(String value)
Sets the ID.void
update()
Updates certain dependant fields.-
Methods inherited from class adams.data.report.Report
addField, addParameter, addParameter, assign, compareTo, equals, getBooleanValue, getBooleanValue, getClone, getDatabaseID, getDoubleValue, getDoubleValue, getFields, getFields, getFields, getFieldType, getLoggingLevel, getParams, getPrefixFields, getStringValue, getStringValue, getSuffixFields, getValue, hasField, hasField, hashCode, hasValue, hasValue, hasValues, hasValues, intersect, isDummyReport, mergeWith, minus, newInstance, removeValue, removeValues, removeValuesStartingWith, setBooleanValue, setDatabaseID, setDummyReport, setLoggingLevel, setNumericValue, setParams, setStringValue, setValue, toProperties, toSpreadSheet, toString
-
-
-
-
Field Detail
-
INSERT_TIMESTAMP
public static final String INSERT_TIMESTAMP
field name for time of insertion into database.- See Also:
- Constant Field Values
-
INSTRUMENT
public static final String INSTRUMENT
field name for the instrument.- See Also:
- Constant Field Values
-
DEFAULT_INSTRUMENT
public static final String DEFAULT_INSTRUMENT
the default instrument ('unknown').- See Also:
- Constant Field Values
-
SAMPLE_ID
public static final String SAMPLE_ID
field name for the sample ID.- See Also:
- Constant Field Values
-
SAMPLE_TYPE
public static final String SAMPLE_TYPE
field name for the sample type.- See Also:
- Constant Field Values
-
FORMAT
public static final String FORMAT
field name for the format.- See Also:
- Constant Field Values
-
DEFAULT_FORMAT
public static final String DEFAULT_FORMAT
the default data type.- See Also:
- Constant Field Values
-
SOURCE
public static final String SOURCE
field name for the source.- See Also:
- Constant Field Values
-
-
Method Detail
-
update
public void update()
Updates certain dependant fields. This method should be called before saving it to the database, after loading it from the database or when a quantitation report has been created by hand.- Overrides:
update
in classadams.data.report.Report
-
createDummy
public static SampleData createDummy(String instrument, Date insertDate, String format)
Creates a dummy report.- Parameters:
instrument
- the instrument this dummy is forinsertDate
- the date for the insertion in the databaseformat
- the format of the data- Returns:
- the generated report
-
parseReport
public static SampleData parseReport(String s)
Parses the string generated by the toString() method.- Parameters:
s
- the string to parse- Returns:
- the generated report
-
parseProperties
public static SampleData parseProperties(adams.core.Properties props)
Parses the properties (generated with the toProperties() method) and generates a sample data object from it.- Parameters:
props
- the properties to generate the sample data from- Returns:
- the sample data
-
initFields
protected void initFields()
Set field types.- Overrides:
initFields
in classadams.data.report.Report
-
getID
public String getID()
Returns the ID.- Specified by:
getID
in interfaceadams.data.id.IDHandler
- Returns:
- the ID
-
setID
public void setID(String value)
Sets the ID.- Specified by:
setID
in interfaceadams.data.id.MutableIDHandler
- Parameters:
value
- the ID
-
-