Class SpreadSheetRow
- java.lang.Object
-
- adams.data.container.AbstractDataContainer<SpreadSheetRowPoint>
-
- adams.gui.visualization.spreadsheet.SpreadSheetRow
-
- All Implemented Interfaces:
CloneHandler
,Mergeable<DataContainer>
,UniqueIDHandler
,DataContainer<SpreadSheetRowPoint>
,IDHandler
,MutableIDHandler
,NotesHandler
,MutableReportHandler<Report>
,ReportHandler<Report>
,SpreadSheetSupporter
,Serializable
,Comparable
,Iterable<SpreadSheetRowPoint>
,Collection<SpreadSheetRowPoint>
public class SpreadSheetRow extends AbstractDataContainer<SpreadSheetRowPoint> implements MutableReportHandler<Report>, NotesHandler, SpreadSheetSupporter
Stores values from Row objects, with X being the attribute index (integer) and Y being the internal value (double).- Version:
- $Revision: 12575 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static DataPointComparator
m_Comparator
the default comparator.protected SpreadSheet
m_DatasetHeader
a reference to the dataset the data was obtained from.protected Notes
m_Notes
the notes for the chromatogram.protected Report
m_Report
the automatically generated report.static String
REPORT_ADDITIONAL_PREFIX
the key prefix in the report for the additional columns.static String
REPORT_DB_ID
the key in the report for the spreadsheet ID.static String
REPORT_DISPLAY_ID
the key in the report for the display ID.static String
REPORT_ID
the key in the report for the ID.static String
REPORT_ROW
the key in the report for the row in the spreadsheet.static String
REPORT_SPREADSHEET
the key in the report for the spreadsheet name.-
Fields inherited from class adams.data.container.AbstractDataContainer
m_ID, m_Points, m_UUID
-
-
Constructor Summary
Constructors Constructor Description SpreadSheetRow()
Initializes the sequence.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assign(DataContainer<SpreadSheetRowPoint> other)
Obtains the stored variables from the other data point, but not the actual data points.void
clear()
Removes all the points and report and nulls the header reference.DataPointComparator<SpreadSheetRowPoint>
getComparator()
Returns the comparator in use.SpreadSheet
getDatasetHeader()
Returns the header of the underlying dataset.Notes
getNotes()
Returns the currently stored notes.Report
getReport()
Returns the report.boolean
hasDatasetHeader()
Returns whether a header of a dataset is available.boolean
hasReport()
Checks whether a report is present.DataPointComparator<SpreadSheetRowPoint>
newComparator()
Returns the comparator in use.SpreadSheetRowPoint
newPoint()
Returns a new instance of a sequence point.protected Report
newReport()
Creates an empty report.void
set(Row row)
Clears the container and adds the data from the Row (internal values).void
set(Row row, int index, int[] additional, Range range, HashSet<Integer> attTypes)
Clears the container and adds the data from the Row (internal values).void
setID(String value)
Sets the ID of the sequence.void
setReport(Report value)
Sets a new report.Row
toRow()
Generates a spreadsheet row, if a spreadsheet header is available.SpreadSheet
toSpreadSheet()
Returns the content as spreadsheet.-
Methods inherited from class adams.data.container.AbstractDataContainer
add, addAll, compareTo, compareToData, compareToHeader, contains, containsAll, ensureCapacity, equals, equalsData, equalsHeader, getClone, getHeader, getID, getUniqueID, hashCode, isEmpty, iterator, mergeWith, modifiedListener, newInstance, remove, removeAll, retainAll, size, toArray, toArray, toList, toList, toString, toTreeSet, toTreeSet, trimToSize
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Field Detail
-
REPORT_SPREADSHEET
public static final String REPORT_SPREADSHEET
the key in the report for the spreadsheet name.- See Also:
- Constant Field Values
-
REPORT_DB_ID
public static final String REPORT_DB_ID
the key in the report for the spreadsheet ID.- See Also:
- Constant Field Values
-
REPORT_ID
public static final String REPORT_ID
the key in the report for the ID.- See Also:
- Constant Field Values
-
REPORT_DISPLAY_ID
public static final String REPORT_DISPLAY_ID
the key in the report for the display ID.- See Also:
- Constant Field Values
-
REPORT_ROW
public static final String REPORT_ROW
the key in the report for the row in the spreadsheet.- See Also:
- Constant Field Values
-
REPORT_ADDITIONAL_PREFIX
public static final String REPORT_ADDITIONAL_PREFIX
the key prefix in the report for the additional columns.- See Also:
- Constant Field Values
-
m_Comparator
protected static DataPointComparator m_Comparator
the default comparator.
-
m_DatasetHeader
protected SpreadSheet m_DatasetHeader
a reference to the dataset the data was obtained from.
-
m_Report
protected Report m_Report
the automatically generated report.
-
m_Notes
protected Notes m_Notes
the notes for the chromatogram.
-
-
Method Detail
-
setID
public void setID(String value)
Sets the ID of the sequence.- Specified by:
setID
in interfaceMutableIDHandler
- Overrides:
setID
in classAbstractDataContainer<SpreadSheetRowPoint>
- Parameters:
value
- the new ID
-
newComparator
public DataPointComparator<SpreadSheetRowPoint> newComparator()
Returns the comparator in use.- Specified by:
newComparator
in interfaceDataContainer<SpreadSheetRowPoint>
- Returns:
- the comparator to use
-
getComparator
public DataPointComparator<SpreadSheetRowPoint> getComparator()
Returns the comparator in use.- Specified by:
getComparator
in interfaceDataContainer<SpreadSheetRowPoint>
- Returns:
- the comparator in use
-
newPoint
public SpreadSheetRowPoint newPoint()
Returns a new instance of a sequence point.- Specified by:
newPoint
in interfaceDataContainer<SpreadSheetRowPoint>
- Returns:
- the new sequence point
-
newReport
protected Report newReport()
Creates an empty report.- Returns:
- the empty report
-
clear
public void clear()
Removes all the points and report and nulls the header reference.- Specified by:
clear
in interfaceCollection<SpreadSheetRowPoint>
- Overrides:
clear
in classAbstractDataContainer<SpreadSheetRowPoint>
- See Also:
m_DatasetHeader
-
assign
public void assign(DataContainer<SpreadSheetRowPoint> other)
Obtains the stored variables from the other data point, but not the actual data points.- Specified by:
assign
in interfaceDataContainer<SpreadSheetRowPoint>
- Overrides:
assign
in classAbstractDataContainer<SpreadSheetRowPoint>
- Parameters:
other
- the data point to get the values from
-
hasDatasetHeader
public boolean hasDatasetHeader()
Returns whether a header of a dataset is available.- Returns:
- true if a header is available
-
getDatasetHeader
public SpreadSheet getDatasetHeader()
Returns the header of the underlying dataset.- Returns:
- the header, null if none currently set
-
set
public void set(Row row)
Clears the container and adds the data from the Row (internal values).- Parameters:
row
- the instance to use
-
set
public void set(Row row, int index, int[] additional, Range range, HashSet<Integer> attTypes)
Clears the container and adds the data from the Row (internal values). Uses only the attributes specified in the range.- Parameters:
row
- the row to useindex
- the row index in the original dataset, use -1 to ignoreadditional
- the indices of the additional attribute values to store in the reportrange
- the range of attributes to limit the instance toattTypes
- whether to restrict to attributes types, null or zero-length array means no restriction
-
hasReport
public boolean hasReport()
Checks whether a report is present.- Specified by:
hasReport
in interfaceReportHandler<Report>
- Returns:
- always true
-
setReport
public void setReport(Report value)
Sets a new report.- Specified by:
setReport
in interfaceMutableReportHandler<Report>
- Parameters:
value
- the new report
-
getReport
public Report getReport()
Returns the report.- Specified by:
getReport
in interfaceReportHandler<Report>
- Returns:
- the report, can be null if none available
-
toRow
public Row toRow()
Generates a spreadsheet row, if a spreadsheet header is available.- Returns:
- the generated row, null if no header available
-
getNotes
public Notes getNotes()
Returns the currently stored notes.- Specified by:
getNotes
in interfaceNotesHandler
- Returns:
- the current notes
-
toSpreadSheet
public SpreadSheet toSpreadSheet()
Returns the content as spreadsheet.- Specified by:
toSpreadSheet
in interfaceSpreadSheetSupporter
- Returns:
- the content
-
-