Package adams.data.threeway
Class ThreeWayData
- java.lang.Object
-
- adams.data.container.AbstractDataContainer<L1Point>
-
- adams.data.threeway.ThreeWayData
-
- All Implemented Interfaces:
adams.core.CloneHandler
,adams.core.Mergeable<adams.data.container.DataContainer>
,adams.core.UniqueIDHandler
,adams.data.container.DataContainer<L1Point>
,adams.data.DatabaseNotesHandler
,adams.data.id.DatabaseIDHandler
,adams.data.id.IDHandler
,adams.data.id.MutableIDHandler
,adams.data.NotesHandler
,adams.data.report.MutableReportHandler<ThreeWayReport>
,adams.data.report.ReportHandler<ThreeWayReport>
,adams.data.spreadsheet.SpreadSheetSupporter
,adams.data.statistics.InformativeStatisticSupporter<ThreeWayDataStatistic>
,Serializable
,Comparable
,Iterable<L1Point>
,Collection<L1Point>
public class ThreeWayData extends adams.data.container.AbstractDataContainer<L1Point> implements adams.data.DatabaseNotesHandler, adams.data.report.MutableReportHandler<ThreeWayReport>, adams.data.statistics.InformativeStatisticSupporter<ThreeWayDataStatistic>, adams.data.spreadsheet.SpreadSheetSupporter
Stores 3-way data and associated meta-data.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static adams.data.container.DataPointComparator<L1Point>
m_Comparator
the default comparator.protected int
m_DatabaseID
database id.protected L1Point
m_MaxX
point of greatest X.protected L1Point
m_MaxY
point of greatest Y.protected L1Point
m_MinX
point of smallest X.protected L1Point
m_MinY
point of smallest Y.protected adams.data.Notes
m_Notes
the notes for the data structure.protected ThreeWayReport
m_Reference
'reference' values.
-
Constructor Summary
Constructors Constructor Description ThreeWayData()
Initialise data.ThreeWayData(String id)
Initialise data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assign(adams.data.container.DataContainer<L1Point> other)
Obtains the stored variables from the other data point, but not the actual data points.int
compareToHeader(Object o)
Compares this object with the specified object for order.boolean
equalsHeader(Object obj)
Indicates whether some other chromatogram's header is "equal to" this ones.L1Point
find(double x, double y)
Returns the level 1 point with the exact X, null if not found.L1Point
findClosest(double x, double y)
Returns the level 1 point with a X closest to the one provided.L2Point
get(double x, double y, double z)
Returns the L2 point associated with the given x, y and z.gnu.trove.list.TDoubleList
getAllData()
Returns all unique data values.gnu.trove.list.TDoubleList
getAllX()
Returns all unique Xs.gnu.trove.list.TDoubleList
getAllY()
Returns all unique Ys.gnu.trove.list.TDoubleList
getAllZ()
Returns all unique Zs.adams.data.container.DataPointComparator<L1Point>
getComparator()
Returns the comparator in use.int
getDatabaseID()
Get database id.L1Point
getMaxX()
Get point with greatest timestamp.L1Point
getMaxY()
Get point with greatest abundance.L1Point
getMinX()
Get point with smallest Timestamp.L1Point
getMinY()
Get point with smallest abundance.adams.data.Notes
getNotes()
Returns the currently stored notes.ThreeWayReport
getReport()
Get the report (reference values).ThreeWayData
getXSubset(double x)
Returns a data structure which contains only the given x values.int
hashCode()
Returns the hashcode.boolean
hasReport()
True if Quantitation Report exists for this chromatogram.protected void
invalidateMinMax()
Invalidates the min/max abundance/timestamp points.protected boolean
modifiedListener(boolean modified)
Method that gets notified about changes in the collection of data points.adams.data.container.DataPointComparator<L1Point>
newComparator()
Returns a new instance of the default comparator.L1Point
newPoint()
Returns a new instance of a DataContainer point.void
setDatabaseID(int value)
Set the database ID.void
setID(String value)
Sets the ID of the chromatogram.void
setReport(ThreeWayReport value)
Set the report (reference values).adams.data.spreadsheet.SpreadSheet
toSpreadSheet()
Returns the content as spreadsheet.ThreeWayDataStatistic
toStatistic()
Returns a statistic object of this data structure.String
toString()
Returns a short string representation of the chromatogram.protected void
validateMinMax()
Initializes the min/max abundance/timestmap points.-
Methods inherited from class adams.data.container.AbstractDataContainer
add, addAll, clear, compareTo, compareToData, contains, containsAll, ensureCapacity, equals, equalsData, getClone, getHeader, getID, getUniqueID, isEmpty, iterator, mergeWith, newInstance, remove, removeAll, retainAll, size, toArray, toArray, toList, toList, 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
-
m_DatabaseID
protected int m_DatabaseID
database id.
-
m_Reference
protected ThreeWayReport m_Reference
'reference' values.
-
m_MaxY
protected L1Point m_MaxY
point of greatest Y.
-
m_MinY
protected L1Point m_MinY
point of smallest Y.
-
m_MaxX
protected L1Point m_MaxX
point of greatest X.
-
m_MinX
protected L1Point m_MinX
point of smallest X.
-
m_Notes
protected adams.data.Notes m_Notes
the notes for the data structure.
-
m_Comparator
protected static adams.data.container.DataPointComparator<L1Point> m_Comparator
the default comparator.
-
-
Constructor Detail
-
ThreeWayData
public ThreeWayData()
Initialise data.
-
ThreeWayData
public ThreeWayData(String id)
Initialise data.- Parameters:
id
- ID for data
-
-
Method Detail
-
newComparator
public adams.data.container.DataPointComparator<L1Point> newComparator()
Returns a new instance of the default comparator.- Specified by:
newComparator
in interfaceadams.data.container.DataContainer<L1Point>
- Returns:
- the comparator instance
-
getComparator
public adams.data.container.DataPointComparator<L1Point> getComparator()
Returns the comparator in use.- Specified by:
getComparator
in interfaceadams.data.container.DataContainer<L1Point>
- Returns:
- the comparator in use
-
newPoint
public L1Point newPoint()
Returns a new instance of a DataContainer point.- Specified by:
newPoint
in interfaceadams.data.container.DataContainer<L1Point>
- Returns:
- the new DataContainer point
-
invalidateMinMax
protected void invalidateMinMax()
Invalidates the min/max abundance/timestamp points.
-
validateMinMax
protected void validateMinMax()
Initializes the min/max abundance/timestmap points.
-
setID
public void setID(String value)
Sets the ID of the chromatogram.- Specified by:
setID
in interfaceadams.data.id.MutableIDHandler
- Overrides:
setID
in classadams.data.container.AbstractDataContainer<L1Point>
- Parameters:
value
- the new ID
-
setDatabaseID
public void setDatabaseID(int value)
Set the database ID.- Parameters:
value
- Database ID
-
getDatabaseID
public int getDatabaseID()
Get database id.- Specified by:
getDatabaseID
in interfaceadams.data.id.DatabaseIDHandler
- Returns:
- database ID
-
setReport
public void setReport(ThreeWayReport value)
Set the report (reference values).- Specified by:
setReport
in interfaceadams.data.report.MutableReportHandler<ThreeWayReport>
- Parameters:
value
- report
-
getReport
public ThreeWayReport getReport()
Get the report (reference values).- Specified by:
getReport
in interfaceadams.data.report.ReportHandler<ThreeWayReport>
- Returns:
- report
-
hasReport
public boolean hasReport()
True if Quantitation Report exists for this chromatogram.- Specified by:
hasReport
in interfaceadams.data.report.ReportHandler<ThreeWayReport>
- Returns:
- does this chromatogram have a Quantitation Report
-
getMaxY
public L1Point getMaxY()
Get point with greatest abundance.- Returns:
- gc point
-
getMinY
public L1Point getMinY()
Get point with smallest abundance.- Returns:
- gc point
-
getMaxX
public L1Point getMaxX()
Get point with greatest timestamp.- Returns:
- gc point
-
getMinX
public L1Point getMinX()
Get point with smallest Timestamp.- Returns:
- gc point
-
modifiedListener
protected boolean modifiedListener(boolean modified)
Method that gets notified about changes in the collection of data points.- Overrides:
modifiedListener
in classadams.data.container.AbstractDataContainer<L1Point>
- Parameters:
modified
- whether the action modified the collection- Returns:
- the same as the input
-
find
public L1Point find(double x, double y)
Returns the level 1 point with the exact X, null if not found.- Parameters:
x
- the X to look fory
- the Y to look for- Returns:
- the level 1 point or null if not found
- See Also:
findClosest(double,double)
-
findClosest
public L1Point findClosest(double x, double y)
Returns the level 1 point with a X closest to the one provided.- Parameters:
x
- the X to look for- Returns:
- the level 1 point
- See Also:
find(double,double)
-
getXSubset
public ThreeWayData getXSubset(double x)
Returns a data structure which contains only the given x values. Adds level 1 points with y=0 if a level 1 point does not contain the chosen x.- Parameters:
x
- the x to look for- Returns:
- the new data structure
-
assign
public void assign(adams.data.container.DataContainer<L1Point> other)
Obtains the stored variables from the other data point, but not the actual data points.
-
compareToHeader
public int compareToHeader(Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.- Specified by:
compareToHeader
in interfaceadams.data.container.DataContainer<L1Point>
- Overrides:
compareToHeader
in classadams.data.container.AbstractDataContainer<L1Point>
- Parameters:
o
- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
ClassCastException
- if the specified object's type prevents it from being compared to this object.
-
equalsHeader
public boolean equalsHeader(Object obj)
Indicates whether some other chromatogram's header is "equal to" this ones.- Specified by:
equalsHeader
in interfaceadams.data.container.DataContainer<L1Point>
- Overrides:
equalsHeader
in classadams.data.container.AbstractDataContainer<L1Point>
- Parameters:
obj
- the reference object with which to compare.- Returns:
- true if this object is the same as the obj argument; false otherwise.
-
hashCode
public int hashCode()
Returns the hashcode. Just the hashcode of the toString()-generated string.- Specified by:
hashCode
in interfaceCollection<L1Point>
- Overrides:
hashCode
in classadams.data.container.AbstractDataContainer<L1Point>
- Returns:
- the hashcode
-
toString
public String toString()
Returns a short string representation of the chromatogram.- Overrides:
toString
in classadams.data.container.AbstractDataContainer<L1Point>
- Returns:
- a string representation
-
toStatistic
public ThreeWayDataStatistic toStatistic()
Returns a statistic object of this data structure.- Specified by:
toStatistic
in interfaceadams.data.statistics.InformativeStatisticSupporter<ThreeWayDataStatistic>
- Returns:
- statistics about this data structure
-
getNotes
public adams.data.Notes getNotes()
Returns the currently stored notes.- Specified by:
getNotes
in interfaceadams.data.NotesHandler
- Returns:
- the current notes
-
toSpreadSheet
public adams.data.spreadsheet.SpreadSheet toSpreadSheet()
Returns the content as spreadsheet.- Specified by:
toSpreadSheet
in interfaceadams.data.spreadsheet.SpreadSheetSupporter
- Returns:
- the content
-
get
public L2Point get(double x, double y, double z)
Returns the L2 point associated with the given x, y and z.- Parameters:
x
- the X of the point to retrievey
- the Y of the point to retrievez
- the Z of the point to retrieve- Returns:
- the point, null if not found for these coordinates
-
getAllX
public gnu.trove.list.TDoubleList getAllX()
Returns all unique Xs.- Returns:
- the list of Xs
-
getAllY
public gnu.trove.list.TDoubleList getAllY()
Returns all unique Ys.- Returns:
- the list of Ys
-
getAllZ
public gnu.trove.list.TDoubleList getAllZ()
Returns all unique Zs.- Returns:
- the list of Zs
-
getAllData
public gnu.trove.list.TDoubleList getAllData()
Returns all unique data values.- Returns:
- the list of data values
-
-